Fixes heartbeat sounds playing indefinitely in certain cases

This commit is contained in:
CitadelStationBot
2017-07-06 08:26:23 -05:00
parent b1b4826c0c
commit 21878a77f0
2 changed files with 5 additions and 0 deletions
@@ -249,6 +249,7 @@ Works together with spawning an observer, noted above.
/mob/proc/ghostize(can_reenter_corpse = 1)
if(key)
if(!cmptext(copytext(key,1,2),"@")) // Skip aghosts.
stop_sound_channel(CHANNEL_HEARTBEAT) //Stop heartbeat sounds because You Are A Ghost Now
var/mob/dead/observer/ghost = new(src) // Transfer safety to observer spawning proc.
SStgui.on_transfer(src, ghost) // Transfer NanoUIs.
ghost.can_reenter_corpse = can_reenter_corpse
@@ -19,6 +19,10 @@
/mob/living/carbon/human/death(gibbed)
if(stat == DEAD)
return
stop_sound_channel(CHANNEL_HEARTBEAT)
var/obj/item/organ/heart/H = getorganslot("heart")
if(H)
H.beat = BEAT_NONE
. = ..()