From f8cf98a78350659672bb60d9e353e7bf1f0f2f8a Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 27 Oct 2021 00:02:51 +0100 Subject: [PATCH] [MIRROR] Don't remove stamcrit on stronger stat [MDB IGNORE] (#9065) * Don't remove stamcrit on stronger stat (#62335) Any time update_stamina was called, such as being reduced by 0.3 while unconscious, it would check to see if stat was set. If so, it would then immediately remove all stamcrit traits, even if these traits were not set to expire before whatever was causing the stat did. This allowed players to enter a very brief unconscious period with the *collapse emote, which would immediately override and remove stamcrit traits, and be able to move around and act freely as soon as the very short emote induced unconsciousness finished. Don't ask how long it took to track this down. Fixes #61890. * Don't remove stamcrit on stronger stat Co-authored-by: esainane --- code/modules/mob/living/carbon/carbon.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 4a2211695c9..3a1db03d02f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -528,8 +528,9 @@ /mob/living/carbon/update_stamina() var/stam = getStaminaLoss() - if(stam > DAMAGE_PRECISION && (maxHealth - stam) <= crit_threshold && !stat) - enter_stamcrit() + if(stam > DAMAGE_PRECISION && (maxHealth - stam) <= crit_threshold) + if (!stat) + enter_stamcrit() else if(HAS_TRAIT_FROM(src, TRAIT_INCAPACITATED, STAMINA)) REMOVE_TRAIT(src, TRAIT_INCAPACITATED, STAMINA) REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, STAMINA)