diff --git a/code/datums/mind.dm b/code/datums/mind.dm index a4699f33ee1..dbff1995067 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -75,10 +75,11 @@ datum/mind current.remove_vampire_powers() current.mind = null - nanomanager.user_transferred(current, new_character) - if(new_character.mind) //remove any mind currently in our new body's mind variable new_character.mind.current = null + + nanomanager.user_transferred(current, new_character) + current = new_character //link ourself to our new body new_character.mind = src //and link our new body to ourself diff --git a/code/modules/nano/nanomanager.dm b/code/modules/nano/nanomanager.dm index 50031483fb6..12b1e57c21c 100644 --- a/code/modules/nano/nanomanager.dm +++ b/code/modules/nano/nanomanager.dm @@ -114,22 +114,26 @@ -/** -* This is called when a player transfers from one mob to another -* Transfers all open UIs to the new mob -* -* @param oldMob /mob The user's old mob -* @param newMob /mob The user's new mob -* -* @return nothing -*/ - + /** + * This is called when a player transfers from one mob to another + * Transfers all open UIs to the new mob + * + * @param oldMob /mob The user's old mob + * @param newMob /mob The user's new mob + * + * @return nothing + */ /datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob) if (isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0) return 0 // has no open uis + if (isnull(newMob.open_uis) || !istype(newMob.open_uis, /list)) newMob.open_uis = list() + for (var/datum/nanoui/ui in oldMob.open_uis) ui.user = newMob newMob.open_uis.Add(ui) - oldMob.open_uis.Cut() \ No newline at end of file + + oldMob.open_uis.Cut() + + return 1 // success