Prevent SecretRule from picking invalid presets (#27456)
* Prevent SecretRule from picking invalid presets * remove lonely semicolon --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
@@ -173,6 +173,26 @@ namespace Content.Server.GameTicking
|
||||
return gridUids;
|
||||
}
|
||||
|
||||
public int ReadyPlayerCount()
|
||||
{
|
||||
var total = 0;
|
||||
foreach (var (userId, status) in _playerGameStatuses)
|
||||
{
|
||||
if (LobbyEnabled && status == PlayerGameStatus.NotReadyToPlay)
|
||||
continue;
|
||||
|
||||
if (!_playerManager.TryGetSessionById(userId, out _))
|
||||
continue;
|
||||
|
||||
if (_banManager.GetRoleBans(userId) == null)
|
||||
continue;
|
||||
|
||||
total++;
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public void StartRound(bool force = false)
|
||||
{
|
||||
#if EXCEPTION_TOLERANCE
|
||||
@@ -228,6 +248,8 @@ namespace Content.Server.GameTicking
|
||||
readyPlayerProfiles.Add(userId, profile);
|
||||
}
|
||||
|
||||
DebugTools.AssertEqual(readyPlayers.Count, ReadyPlayerCount());
|
||||
|
||||
// Just in case it hasn't been loaded previously we'll try loading it.
|
||||
LoadMaps();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user