Fixes NanoUI transfer runtime.

No longer unconditionally attempts to transfer NanoUIs from one mob to another.
Previously caused runtimes if the source-mob was gibbed or otherwise destroyed.
This commit is contained in:
PsiOmega
2015-03-04 09:46:49 +01:00
parent 6affacb983
commit 05c487ca8f
2 changed files with 30 additions and 30 deletions

View File

@@ -72,11 +72,11 @@ datum/mind
current.remove_changeling_powers()
current.verbs -= /datum/changeling/proc/EvolutionMenu
current.mind = null
nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user
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) // transfer active NanoUI instances to new user
current = new_character //link ourself to our new body
new_character.mind = src //and link our new body to ourself

View File

@@ -219,7 +219,7 @@
*/
/datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob)
//testing("nanomanager/user_transferred from mob [oldMob.name] to mob [newMob.name]")
if (isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0)
if (!oldMob || isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0)
//testing("nanomanager/user_transferred mob [oldMob.name] has no open uis")
return 0 // has no open uis