Small NanoUI fixes

This commit is contained in:
ZomgPonies
2014-01-03 20:58:00 -05:00
parent 2ee199c20b
commit f562ac1b5f
2 changed files with 18 additions and 13 deletions
+3 -2
View File
@@ -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
+15 -11
View File
@@ -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()
oldMob.open_uis.Cut()
return 1 // success