Skip to content

Commit

Permalink
CSMultiplayerRules: be explicit about calling NSGameRules::PlayerDisc…
Browse files Browse the repository at this point in the history
…onnect() to handle player de-init
  • Loading branch information
eukara committed Mar 2, 2023
1 parent cb12c5d commit f74e44e
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions src/server/gamerules_multiplayer.qc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CSMultiplayerRules::PlayerDisconnect(NSClientPlayer pl)
if (health > 0)
PlayerDeath(pl);

super::PlayerDisconnect(pl);
NSGameRules::PlayerDisconnect(pl);
}

void
Expand Down Expand Up @@ -687,35 +687,20 @@ CSMultiplayerRules::CountPlayers(void)
g_cs_total_t = 0;
g_cs_total_ct = 0;

for (entity eFind = world; (eFind = findfloat(eFind, ::team, TEAM_T));) {
if (!(eFind.flags & FL_CLIENT))
continue;

g_cs_total_t++;

if (eFind.health > 0)
g_cs_alive_t++;
}
for (entity eFind = world; (eFind = findfloat(eFind, ::team, TEAM_CT));) {
if (!(eFind.flags & FL_CLIENT))
continue;
for (entity eFind = world; (eFind = find(eFind, ::classname, "player"));) {
if (eFind.team == TEAM_T) {
g_cs_total_t++;

g_cs_total_ct++;
if (eFind.health > 0)
g_cs_alive_t++;
} else if (eFind.team == TEAM_CT || eFind.team == TEAM_VIP) {
g_cs_total_ct++;

if (eFind.health > 0)
g_cs_alive_ct++;
}
for (entity eFind = world; (eFind = findfloat(eFind, ::team, TEAM_VIP));) {
if (!(eFind.flags & FL_CLIENT))
continue;

g_cs_total_ct++;

if (eFind.health > 0)
g_cs_alive_ct++;
if (eFind.health > 0)
g_cs_alive_ct++;
}
}


g_total_players = g_cs_total_t + g_cs_total_ct;
}

Expand Down

0 comments on commit f74e44e

Please sign in to comment.