From d29b05934ce08d4093db84231e1e38a07c6937d0 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 14 Aug 2021 15:18:27 +0200 Subject: [PATCH] LMS: improve rank assignment to forfeiters --- qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc | 9 ++++----- qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index dd2c93e50..b05a960dd 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -118,7 +118,6 @@ int WinningCondition_LMS() MUTATOR_HOOKFUNCTION(lms, reset_map_global) { lms_lowest_lives = 999; - lms_quitters = 0; } MUTATOR_HOOKFUNCTION(lms, reset_map_players) @@ -262,6 +261,7 @@ void lms_RemovePlayer(entity player) } else { + int min_forfeiter_rank = 665; // different from 666 FOREACH_CLIENT(true, { // update rank of other players that were eliminated if (it.frags == FRAGS_PLAYER_OUT_OF_GAME) @@ -269,6 +269,8 @@ void lms_RemovePlayer(entity player) float it_rank = GameRules_scoring_add(it, LMS_RANK, 0); if (it_rank > player_rank && it_rank <= 256) GameRules_scoring_add(it, LMS_RANK, -1); + if (it_rank > 256 && it_rank <= min_forfeiter_rank) + min_forfeiter_rank = it_rank - 1; } else if (it.frags != FRAGS_SPECTATOR) { @@ -277,12 +279,9 @@ void lms_RemovePlayer(entity player) lms_lowest_lives = tl; } }); - GameRules_scoring_add(player, LMS_RANK, 665 - lms_quitters); // different from 666 + GameRules_scoring_add(player, LMS_RANK, min_forfeiter_rank); if(!warmup_stage) - { GameRules_scoring_add(player, LMS_LIVES, -GameRules_scoring_add(player, LMS_LIVES, 0)); - ++lms_quitters; - } player.frags = FRAGS_PLAYER_OUT_OF_GAME; TRANSMUTE(Observer, player); } diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh index bbaa4728b..191553012 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh @@ -9,8 +9,6 @@ .int lms_spectate_warning; .int lmsplayer; -int lms_quitters = 0; - #define autocvar_g_lms_lives_override cvar("g_lms_lives_override") string autocvar_g_lms_weaponarena = "most_available"; -- 2.39.2