Cleans up observer mind on control transfer, ghosting, DNR, suicide (#47826)

* Fixes admin ghost drag

* Covers more cases

* And assume control
This commit is contained in:
skoglol
2019-11-18 17:59:47 +00:00
committed by Emmett Gaines
parent 0d32c6dad1
commit ad0d270d58
4 changed files with 25 additions and 14 deletions
+9 -4
View File
@@ -261,7 +261,7 @@ Transfer_mind is there to check if mob is being deleted/not going to have a body
Works together with spawning an observer, noted above.
*/
/mob/proc/ghostize(can_reenter_corpse = 1)
/mob/proc/ghostize(can_reenter_corpse = TRUE)
if(key)
if(!cmptext(copytext(key,1,2),"@")) // Skip aghosts.
stop_sound_channel(CHANNEL_HEARTBEAT) //Stop heartbeat sounds because You Are A Ghost Now
@@ -269,6 +269,8 @@ Works together with spawning an observer, noted above.
SStgui.on_transfer(src, ghost) // Transfer NanoUIs.
ghost.can_reenter_corpse = can_reenter_corpse
ghost.key = key
if(!can_reenter_corpse) // Disassociates observer mind from the body mind
ghost.mind = null
return ghost
/*
@@ -282,12 +284,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(stat != DEAD)
succumb()
if(stat == DEAD)
ghostize(1)
ghostize(TRUE)
else
var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst still alive you may not play again this round! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body")
if(response != "Ghost")
return //didn't want to ghost after-all
ghostize(0) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3
ghostize(FALSE) // FALSE parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3
/mob/camera/verb/ghost()
set category = "OOC"
@@ -297,7 +299,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst still alive you may not play again this round! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body")
if(response != "Ghost")
return
ghostize(0)
ghostize(FALSE)
/mob/dead/observer/Move(NewLoc, direct)
if(updatedir)
@@ -353,6 +355,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
can_reenter_corpse = FALSE
// Disassociates observer mind from the body mind
mind = null
to_chat(src, "<span class='boldnotice'>You can no longer be brought back into your body.</span>")
return TRUE