Skip to content

Commit

Permalink
Fix station events schedulers, antag selection and possibly other sys…
Browse files Browse the repository at this point in the history
…tems acting weird in a rare scenario
  • Loading branch information
ficcialfaint committed Nov 8, 2024
1 parent 6ed2ab9 commit 04ea8ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Antag/AntagSelectionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected override void Started(EntityUid uid, AntagSelectionComponent component
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);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/GameTicking/GameTicker.Lobby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ public bool UserHasJoinedGame(ICommonSession session)
=> UserHasJoinedGame(session.UserId);

public bool UserHasJoinedGame(NetUserId userId)
=> PlayerGameStatuses[userId] == PlayerGameStatus.JoinedGame;
=> PlayerGameStatuses.TryGetValue(userId, out var status) && status == PlayerGameStatus.JoinedGame;
}
}

0 comments on commit 04ea8ad

Please sign in to comment.