diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 402f94e837e..e95381d19cf 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -140,12 +140,14 @@ /mob/living/proc/StartResting(updating = 1) var/val_change = !resting resting = TRUE + if(updating && val_change) update_canmove() /mob/living/proc/StopResting(updating = 1) var/val_change = !!resting resting = FALSE + if(updating && val_change) update_canmove() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 2e83e9b9a95..83218917e86 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -380,9 +380,16 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) set name = "Rest" set category = "IC" - resting = !resting - update_canmove() - to_chat(src, "You are now [resting ? "resting" : "getting up"].") + if(world.time < client.move_delay) + return + + if(!resting) + client.move_delay = world.time + 20 + to_chat(src, "You are now resting.") + StartResting() + else if(resting) + to_chat(src, "You are now getting up.") + StopResting() /proc/is_blind(A) if(iscarbon(A))