Fixes tempbody taking aghosted bodies (#95996)

## About The Pull Request

If you're an adminghosted body, you will no longer be sent back to your
corpse afterwards. The Mind will still move over, but you wont
immediately re-enter your body.

Just as an example, an Admin is aghosted on Centcom after testing some
stuff, plays a round of Mafia, then is suddenly back in their body in
Centcom.

Also fixes temp body not working for Mafia (due to the corpse locking)

## Why It's Good For The Game

You're going to the THUNDERDOME.

## Changelog

🆑
fix: Mafia players now get sent back to their bodies again post-game.
admin: Admin players aren't forcefully put back into aghosted bodies
after using a temporary body spawner.
/🆑
This commit is contained in:
John Willard
2026-05-20 18:15:17 +02:00
committed by GitHub
parent 960d0a7278
commit 3ea6c1ddea
4 changed files with 17 additions and 12 deletions
+2 -2
View File
@@ -79,7 +79,7 @@
SIGNAL_HANDLER
var/mob/new_body = parent
var/mob/dead/observer/ghost = new_body.get_ghost() || new_body.ghostize()
var/mob/dead/observer/ghost = new_body.get_ghost() || new_body.ghostize(forced = TRUE)
if(QDELETED(ghost))
stack_trace("[src] belonging to [parent] was completely unable to find a ghost to put back into a body!")
qdel(src) // i guess this is useless now
@@ -90,7 +90,7 @@
if(old_mind.current != old_body)
stack_trace("Temporary body returning mind to old body, but the mind's current body doesn't match the old body!")
old_mind.set_current(old_body)
if(old_body.stat != DEAD)
if(old_body.stat != DEAD && !IS_FAKE_KEY(old_body.key))
ghost.reenter_corpse()
qdel(src) // we're done here
+1
View File
@@ -472,6 +472,7 @@
if(G.can_reenter_corpse || even_if_they_cant_reenter)
return G
break
return null
/datum/mind/proc/grab_ghost(force)
var/mob/dead/observer/G = get_ghost(even_if_they_cant_reenter = force)