[MIRROR] Mob stays vertical while in cryo (#1639)

* Mob stays vertical while in cryo (#54800)

Currently, mobs in cryo will turn horizontal in the cryotube when they fall unconscious. This should stop that.

* Mob stays vertical while in cryo

Co-authored-by: prodirus <44090982+prodirus@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-11-09 08:42:53 +00:00
committed by GitHub
co-authored by prodirus
parent da9b2794e9
commit 6b1da44c8a
5 changed files with 21 additions and 5 deletions
+14
View File
@@ -12,6 +12,9 @@
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FLOORED), .proc/on_floored_trait_gain)
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FLOORED), .proc/on_floored_trait_loss)
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FORCED_STANDING), .proc/on_forced_standing_trait_gain)
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FORCED_STANDING), .proc/on_forced_standing_trait_loss)
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), .proc/on_handsblocked_trait_gain)
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_HANDS_BLOCKED), .proc/on_handsblocked_trait_loss)
@@ -78,6 +81,8 @@
SIGNAL_HANDLER
if(buckled && buckled.buckle_lying != NO_BUCKLE_LYING)
return // Handled by the buckle.
if(HAS_TRAIT(src, TRAIT_FORCED_STANDING))
return // Don't go horizontal if mob has forced standing trait.
mobility_flags &= ~MOBILITY_STAND
on_floored_start()
@@ -88,6 +93,15 @@
mobility_flags |= MOBILITY_STAND
on_floored_end()
/// Called when [TRAIT_FORCED_STANDING] is added to the mob.
/mob/living/proc/on_forced_standing_trait_gain(datum/source)
set_body_position(STANDING_UP)
set_lying_angle(0)
/// Called when [TRAIT_FORCED_STANDING] is removed from the mob.
/mob/living/proc/on_forced_standing_trait_loss(datum/source)
if(resting || HAS_TRAIT(src, TRAIT_FLOORED))
set_lying_down()
/// Called when [TRAIT_HANDS_BLOCKED] is added to the mob.
/mob/living/proc/on_handsblocked_trait_gain(datum/source)
+1 -1
View File
@@ -490,7 +490,7 @@
if(body_position == LYING_DOWN)
if(!silent)
to_chat(src, "<span class='notice'>You will now try to stay lying down on the floor.</span>")
else if(buckled && buckled.buckle_lying != NO_BUCKLE_LYING)
else if(HAS_TRAIT(src, TRAIT_FORCED_STANDING) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING))
if(!silent)
to_chat(src, "<span class='notice'>You will now lay down as soon as you are able to.</span>")
else