[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:
parent
d5aae3dada
commit
07c7d6284e
1 changed files with 5 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue