[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 <esainane+github@gmail.com>
This commit is contained in:
SkyratBot
2021-10-26 19:02:51 -04:00
committed by GitHub
co-authored by esainane
parent fce9a5d7a2
commit f8cf98a783
+3 -2
View File
@@ -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)