mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Replace direct uses of GameTicker dictionary with TryGetValue (#33222)
Fix station events schedulers, antag selection and possibly other systems acting weird in a rare scenario
This commit is contained in:
parent
647db6aa87
commit
79ff990ddf
2 changed files with 2 additions and 2 deletions
|
|
@ -184,7 +184,7 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
|
|||
return;
|
||||
|
||||
var players = _playerManager.Sessions
|
||||
.Where(x => GameTicker.PlayerGameStatuses[x.UserId] == PlayerGameStatus.JoinedGame)
|
||||
.Where(x => GameTicker.PlayerGameStatuses.TryGetValue(x.UserId, out var status) && status == PlayerGameStatus.JoinedGame)
|
||||
.ToList();
|
||||
|
||||
ChooseAntags((uid, component), players, midround: true);
|
||||
|
|
|
|||
|
|
@ -184,6 +184,6 @@ namespace Content.Server.GameTicking
|
|||
=> UserHasJoinedGame(session.UserId);
|
||||
|
||||
public bool UserHasJoinedGame(NetUserId userId)
|
||||
=> PlayerGameStatuses[userId] == PlayerGameStatus.JoinedGame;
|
||||
=> PlayerGameStatuses.TryGetValue(userId, out var status) && status == PlayerGameStatus.JoinedGame;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue