From: terencehill Date: Tue, 18 Dec 2018 14:16:35 +0000 (+0100) Subject: LMS: don't show "X has no more lives left" message for a player that disconnects X-Git-Tag: xonotic-v0.8.5~1686 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cafcd37f2c82f2fc76b3c87157870cbb1ffe009c;p=xonotic%2Fxonotic-data.pk3dir.git LMS: don't show "X has no more lives left" message for a player that disconnects --- diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index b10cffb74..338fb89dc 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -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); }