diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 46fd659d81..a9f39fb127 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1255,3 +1255,28 @@ var/global/floorIsLava = 0 //ALL DONE //********************************************************************************************************* // + +/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 + + //Same as assume-direct-control perm requirements. + if (!check_rights(R_VAREDIT,0) || !check_rights(R_ADMIN|R_DEBUG,0)) + return 0 + if (!frommob.ckey) + return 0 + var/question = "" + if (tomob.ckey) + question = "This mob already has a user ([tomob.key]) in control of it! " + question += "Are you sure you want to place [frommob.name]([frommob.key]) in control of [tomob.name]?" + var/ask = alert(question, "Place ghost in control of mob?", "Yes", "No") + if (ask != "Yes") + return 1 + if(tomob.client) //No need to ghostize if there is no client + tomob.ghostize(0) + message_admins("[key_name_admin(usr)] has put [frommob.ckey] in control of [tomob.name].") + log_admin("[key_name(usr)] stuffed [frommob.ckey] into [tomob.name].") + feedback_add_details("admin_verb","CGD") + tomob.ckey = frommob.ckey + qdel(frommob) + return 1 diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 850bd531df..ee8194a004 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -482,6 +482,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp src << browse(dat, "window=manifest;size=370x420;can_close=1") +//This is called when a ghost is drag clicked to something. +/mob/dead/observer/MouseDrop(atom/over) + if (isobserver(usr) && usr.client && usr.client.holder && isliving(over)) + if (usr.client.holder.cmd_ghost_drag(src,over)) + return + + return ..() + //Used for drawing on walls with blood puddles as a spooky ghost. /mob/dead/verb/bloody_doodle()