mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-15 03:31:30 +01:00
[HOTFIX] Fix Antags failing to roll. (#40658)
Use TryGetCached instead of GetCached Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d5aae3dada
commit
07c7d6284e
@@ -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<ProtoId<AntagPrototype>>{role};
|
||||
|
||||
|
||||
if (pref.AntagPreferences.Contains(role)
|
||||
if (character.AntagPreferences.Contains(role)
|
||||
&& !_ban.IsRoleBanned(session, list)
|
||||
&& _playTime.IsAllowed(session, list))
|
||||
valid = true;
|
||||
|
||||
Reference in New Issue
Block a user