From f593f094866ee463d77f90812b818ca3e731cae3 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 3 Nov 2022 00:15:14 +0100 Subject: [PATCH] LMS: correctly update last forfeiter's health and armor if they forfeited when dead Also remove a TODO comment I resolved in the previous commit --- qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc | 10 ++++++---- qcsrc/common/notifications/all.inc | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index b2ab903cb..013de60d6 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -367,17 +367,19 @@ void lms_RemovePlayer(entity player) if(!warmup_stage) { int pl_lives = GameRules_scoring_add(player, LMS_LIVES, 0); + float pl_health = IS_DEAD(player) ? start_health : GetResource(player, RES_HEALTH); + float pl_armor = IS_DEAD(player) ? start_armorvalue : GetResource(player, RES_ARMOR); if (!last_forfeiter_lives || pl_lives < last_forfeiter_lives) { last_forfeiter_lives = pl_lives; - last_forfeiter_health = GetResource(player, RES_HEALTH); - last_forfeiter_armorvalue = GetResource(player, RES_ARMOR); + last_forfeiter_health = pl_health; + last_forfeiter_armorvalue = pl_armor; } else if (pl_lives == last_forfeiter_lives) { // these values actually can belong to a different forfeiter - last_forfeiter_health = min(last_forfeiter_health, GetResource(player, RES_HEALTH)); - last_forfeiter_armorvalue = min(last_forfeiter_armorvalue, GetResource(player, RES_ARMOR)); + last_forfeiter_health = min(last_forfeiter_health, pl_health); + last_forfeiter_armorvalue = min(last_forfeiter_armorvalue, pl_armor); } GameRules_scoring_add(player, LMS_LIVES, -pl_lives); } diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 671a32467..ec5616f97 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -707,7 +707,6 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MULTITEAM_CENTER(KEYHUNT_START, N_ENABLE, 0, 0, "", CPID_KEYHUNT, "0 0", _("^BGYou are starting with the ^TC^TT Key"), "", KEY) MSG_CENTER_NOTIF(LMS_NOLIVES, N_ENABLE, 0, 0, "", CPID_LMS, "0 0", _("^BGYou have no lives left, you must wait until the next match"), "") - // TODO update notifications.cfg MSG_CENTER_NOTIF(LMS_VISIBLE_LEADER, N_ENABLE, 0, 0, "", CPID_LMS, "0 0", _("^BGEnemies can now see you on radar!"), "") MSG_CENTER_NOTIF(LMS_VISIBLE_OTHER, N_ENABLE, 0, 0, "", CPID_LMS, "0 0", _("^BGLeaders can now be seen by enemies on radar!"), "") -- 2.39.2