let's make this work

This commit is contained in:
kevinz000
2020-02-19 07:20:16 -07:00
parent 950082f537
commit 4a537d770d
6 changed files with 19 additions and 13 deletions
+8 -6
View File
@@ -10,10 +10,13 @@
//Force-set resting variable, without needing to resist/etc.
/mob/living/proc/set_resting(new_resting, silent = FALSE, updating = TRUE)
resting = new_resting
if(!silent)
to_chat(src, "<span class='notice'>You are now [resting? "resting" : "getting up"].</span>")
update_resting(updating)
if(new_resting != resting)
resting = new_resting
if(!silent)
to_chat(src, "<span class='notice'>You are now [resting? "resting" : "getting up"].</span>")
update_resting(updating)
if(has_gravity() && resting)
playsound(src, "bodyfall", 20, 1)
/mob/living/proc/update_resting(update_mobility = TRUE)
if(update_mobility)
@@ -168,8 +171,7 @@
//Handle lying down, voluntary or involuntary
density = !lying
if(lying)
if(!lying_prev)
set_resting(TRUE, TRUE, FALSE)
set_resting(TRUE, TRUE, FALSE)
if(layer == initial(layer)) //to avoid special cases like hiding larvas.
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
else