From: terencehill Date: Wed, 22 Jan 2020 19:23:27 +0000 (+0100) Subject: Count active players only when needed X-Git-Tag: xonotic-v0.8.5~1110^2~4^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3ad1cb410e1f1b2c0bb526f14f3a47c77cb0a62f;p=xonotic%2Fxonotic-data.pk3dir.git Count active players only when needed --- diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index 66f2937c6..61a6d701b 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -184,15 +184,15 @@ void lms_RemovePlayer(entity player) float player_rank = GameRules_scoring_add(player, LMS_RANK, 0); if (!player_rank) { - int pl_cnt = 0; - FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_PLAYER_OUT_OF_GAME, { - pl_cnt++; - }); if (player.lms_spectate_warning < 2) { if(IS_BOT_CLIENT(player)) bot_clear(player); player.frags = FRAGS_PLAYER_OUT_OF_GAME; + int pl_cnt = 0; + FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_PLAYER_OUT_OF_GAME, { + pl_cnt++; + }); GameRules_scoring_add(player, LMS_RANK, pl_cnt + 1); } else