diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ca173606fb..83e1ceba1d 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1104,8 +1104,7 @@ if (mind) //Are they SSD? If so we'll keep them asleep but work off some of that sleep var in case of stoxin or similar. if(client || sleeping > 3) - AdjustSleeping(-1) - throw_alert("asleep", /obj/screen/alert/asleep) + handle_sleeping() if( prob(2) && health && client ) spawn(0) emote("snore") diff --git a/code/modules/mob/living/carbon/nymph/life.dm b/code/modules/mob/living/carbon/nymph/life.dm index b12d44fd4a..ac187b28de 100644 --- a/code/modules/mob/living/carbon/nymph/life.dm +++ b/code/modules/mob/living/carbon/nymph/life.dm @@ -66,7 +66,7 @@ if(sleeping) adjustHalLoss(-3) if(mind && mind.active && client) - AdjustSleeping(-1) + handle_sleeping() SetBlinded(TRUE) set_stat(UNCONSCIOUS) else if(resting) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 12221ae9f4..32a7a419d1 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -41,10 +41,10 @@ //Check if we're on fire handle_fire() - + if(client && !(client.prefs.ambience_freq == 0)) // Handle re-running ambience to mobs if they've remained in an area, AND have an active client assigned to them, and do not have repeating ambience disabled. handle_ambience() - + //stuff in the stomach handle_stomach() @@ -122,6 +122,14 @@ handle_slurring() handle_confused() +/mob/living/proc/handle_sleeping() + if(sleeping) + AdjustSleeping(-1) + throw_alert("asleep", /obj/screen/alert/asleep) + else + clear_alert("asleep") + return sleeping + /mob/living/proc/handle_stunned() if(stunned) AdjustStunned(-1) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index c0c05b9964..4f50da4435 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -78,7 +78,7 @@ if(src.sleeping) Paralyse(3) - AdjustSleeping(-1) + handle_sleeping() if(src.resting) Weaken(5) diff --git a/code/modules/mob/living/simple_mob/life.dm b/code/modules/mob/living/simple_mob/life.dm index 1d6347c138..43ec32d64b 100644 --- a/code/modules/mob/living/simple_mob/life.dm +++ b/code/modules/mob/living/simple_mob/life.dm @@ -6,6 +6,7 @@ if(stat >= DEAD) return FALSE + handle_sleeping() handle_stunned() handle_weakened() handle_paralysed()