Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused change has no unresolved issues.
Pull request overview
Fixes warmup player-ratio calculations by excluding SourceTV clients.
Changes:
- Adds SourceTV-aware player counting.
- Uses filtered counts for connected and in-game ratios.
File summaries
| File | Description |
|---|---|
addons/sourcemod/scripting/TeamManager.sp |
Excludes SourceTV clients from warmup ratio calculations. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Suggestion: default - int ClientsConnected = GetWarmupPlayerCount(false);
- int ClientsInGame = GetWarmupPlayerCount(true);
+ int ClientsConnected, ClientsInGame;
+ GetWarmupPlayerCounts(ClientsConnected, ClientsInGame);
int ClientsNeeded = RoundToCeil(float(ClientsConnected) * g_cvPlayersRatio.FloatValue);-stock int GetWarmupPlayerCount(bool InGameOnly)
+stock void GetWarmupPlayerCounts(int &ClientsConnected, int &ClientsInGame)
{
- int Clients = 0;
+ ClientsConnected = 0;
+ ClientsInGame = 0;
for (int client = 1; client <= MaxClients; client++)
{
- if (!IsClientConnected(client) || IsClientSourceTV(client))
+ if (!IsClientConnected(client) || IsClientSourceTV(client) || IsWarmupSpectator(client))
{
continue;
}
- if (InGameOnly && !IsClientInGame(client))
- {
- continue;
- }
-
- if (IsWarmupSpectator(client))
- {
- continue;
- }
-
- Clients++;
+ ClientsConnected++;
+
+ if (IsClientInGame(client))
+ {
+ ClientsInGame++;
+ }
}
-
- return Clients;
}I couldn't push directly to this branch — 🤖 Generated with Claude Code |
Excludes SourceTV clients from the connected and in-game player counts used by the warmup ratio.
Fixes #42