]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
LMS: improve rank assignment to forfeiters
authorterencehill <piuntn@gmail.com>
Sat, 14 Aug 2021 13:18:27 +0000 (15:18 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 16 Aug 2021 18:31:29 +0000 (20:31 +0200)
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh

index dd2c93e5037af969fd62155846a8a94b1ebac134..b05a960dde448b10f98fe72a7ec148bb04fa4eb9 100644 (file)
@@ -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);
                }
index bbaa4728be17c0a144f7f3ab7350e1a070d82feb..1915530122d347fff45a0045bf8e93173ec53578 100644 (file)
@@ -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";