]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
LMS: don't show "X has no more lives left" message for a player that disconnects
authorterencehill <piuntn@gmail.com>
Tue, 18 Dec 2018 14:16:35 +0000 (15:16 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 18 Dec 2018 14:16:35 +0000 (15:16 +0100)
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc

index b10cffb74998bb7c8e09d9fef3e449529db93086..338fb89dc2101756c3643b899d4b53a2a6ec4298 100644 (file)
@@ -186,7 +186,7 @@ void lms_RemovePlayer(entity player)
        {
                int pl_cnt = 0;
                FOREACH_CLIENT(IS_PLAYER(it), { pl_cnt++; });
-               if (player.lms_spectate_warning != 2)
+               if (player.lms_spectate_warning < 2)
                {
                        if(IS_BOT_CLIENT(player))
                                bot_clear(player);
@@ -224,8 +224,8 @@ void lms_RemovePlayer(entity player)
                        lms_lowest_lives = 0; // end the game now!
        }
 
-       if(CS(player).killcount != FRAGS_SPECTATOR)
-               if(GameRules_scoring_add(player, LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2)
+       if (CS(player).killcount != FRAGS_SPECTATOR && player.lms_spectate_warning < 3)
+               if (GameRules_scoring_add(player, LMS_RANK, 0) > 0 && player.lms_spectate_warning < 2)
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_NOLIVES, player.netname);
                else
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_FORFEIT, player.netname);
@@ -235,6 +235,9 @@ MUTATOR_HOOKFUNCTION(lms, ClientDisconnect)
 {
        entity player = M_ARGV(0, entity);
 
+       // no further message other than the disconnect message
+       player.lms_spectate_warning = 3;
+
        lms_RemovePlayer(player);
 }