diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 3ca884da7bd..a108dd54287 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -988,6 +988,8 @@ proc/formatLocation(var/location) proc/formatPlayerPanel(var/mob/U,var/text="PP") return "[text]" +//returns 1 to let the dragdrop code know we are trapping this event +//returns 0 if we don't plan to trap the event /datum/admins/proc/cmd_ghost_drag(var/mob/dead/observer/frommob, var/mob/living/tomob) if(!istype(frommob)) return //extra sanity check to make sure only observers are shoved into things @@ -999,6 +1001,7 @@ proc/formatPlayerPanel(var/mob/U,var/text="PP") if (!frommob.ckey) return 0 + var/question = "" if (tomob.ckey) question = "This mob already has a user ([tomob.key]) in control of it! " @@ -1008,6 +1011,9 @@ proc/formatPlayerPanel(var/mob/U,var/text="PP") if (ask != "Yes") return 1 + if(!frommob || !tomob) //make sure the mobs don't go away while we waited for a response + return 1 + if(tomob.client) //no need to ghostize if there is no client tomob.ghostize(0) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index b5a67bd61dd..22af8b0bedc 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -489,6 +489,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp //this is called when a ghost is drag clicked to something. /mob/dead/observer/MouseDrop(atom/over) + if(!usr || !over) return if (isobserver(usr) && usr.client && usr.client.holder && isliving(over)) if (usr.client.holder.cmd_ghost_drag(src,over)) return