From 07c7d6284ee2b4a7140654235b6ca59a5d1fa834 Mon Sep 17 00:00:00 2001 From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Thu, 2 Oct 2025 09:52:07 -0700 Subject: [PATCH] [HOTFIX] Fix Antags failing to roll. (#40658) Use TryGetCached instead of GetCached Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- Content.Server/Antag/AntagSelectionSystem.API.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Content.Server/Antag/AntagSelectionSystem.API.cs b/Content.Server/Antag/AntagSelectionSystem.API.cs index 6703b7b7ca..5debd10b6e 100644 --- a/Content.Server/Antag/AntagSelectionSystem.API.cs +++ b/Content.Server/Antag/AntagSelectionSystem.API.cs @@ -174,7 +174,10 @@ public sealed partial class AntagSelectionSystem if (roles.Count == 0) return false; - var pref = (HumanoidCharacterProfile) _pref.GetPreferences(session.UserId).SelectedCharacter; + if (!_pref.TryGetCachedPreferences(session.UserId, out var pref)) + return false; + + var character = (HumanoidCharacterProfile) pref.SelectedCharacter; var valid = false; @@ -183,8 +186,7 @@ public sealed partial class AntagSelectionSystem { var list = new List>{role}; - - if (pref.AntagPreferences.Contains(role) + if (character.AntagPreferences.Contains(role) && !_ban.IsRoleBanned(session, list) && _playTime.IsAllowed(session, list)) valid = true; -- 2.51.2