From: terencehill Date: Sat, 14 Aug 2021 13:18:27 +0000 (+0200) Subject: LMS: improve rank assignment to forfeiters X-Git-Tag: xonotic-v0.8.5~350^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d29b05934ce08d4093db84231e1e38a07c6937d0;p=xonotic%2Fxonotic-data.pk3dir.git LMS: improve rank assignment to forfeiters --- 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";