From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:52:07 +0000 (-0700) Subject: [HOTFIX] Fix Antags failing to roll. (#40658) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=07c7d6284ee2b4a7140654235b6ca59a5d1fa834;p=space-station-14.git [HOTFIX] Fix Antags failing to roll. (#40658) Use TryGetCached instead of GetCached Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- 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;