]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_lms.qc
Port killcount to ClientState
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_lms.qc
index c325a359500a955812465a4443a512420730be0a..fbe6b0c1da9c5d60e3703522c3c73157aa84d834 100644 (file)
@@ -176,6 +176,8 @@ void lms_RemovePlayer(entity player)
                FOREACH_CLIENT(IS_PLAYER(it), { pl_cnt++; });
                if (player.lms_spectate_warning != 2)
                {
+                       if(IS_BOT_CLIENT(player))
+                               bot_clear(player);
                        player.frags = FRAGS_LMS_LOSER;
                        PlayerScore_Add(player, SP_LMS_RANK, pl_cnt + 1);
                }
@@ -210,7 +212,7 @@ void lms_RemovePlayer(entity player)
                        lms_lowest_lives = 0; // end the game now!
        }
 
-       if(player.killcount != FRAGS_SPECTATOR)
+       if(CS(player).killcount != FRAGS_SPECTATOR)
                if(PlayerScore_Add(player, SP_LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2)
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_NOLIVES, player.netname);
                else
@@ -281,6 +283,8 @@ MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
                {
                        int pl_cnt = 0;
                        FOREACH_CLIENT(IS_PLAYER(it), { pl_cnt++; });
+                       if(IS_BOT_CLIENT(frag_target))
+                               bot_clear(frag_target);
                        frag_target.frags = FRAGS_LMS_LOSER;
                        PlayerScore_Add(frag_target, SP_LMS_RANK, pl_cnt);
                }
@@ -410,7 +414,7 @@ MUTATOR_HOOKFUNCTION(lms, GetPlayerStatus)
 
 MUTATOR_HOOKFUNCTION(lms, AddPlayerScore)
 {
-       if(gameover)
+       if(game_stopped)
        if(M_ARGV(0, entity) == SP_LMS_RANK) // score field
                return true; // allow writing to this field in intermission as it is needed for newly joining players
 }