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;