diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 04fd912e7c1..e2eb8c36624 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1353,3 +1353,36 @@ proc/formatLocation(location) proc/formatPlayerPanel(var/mob/U,var/text="PP") return "[text]" + +//Credit to MrStonedOne from TG for this QoL improvement +//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 we couldn't do it manually, we can't do it here - the 0 means no message is displayed for failure + if (!check_rights(R_VAREDIT, 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]?" + if(alert(question, "Place ghost in control of mob?", "Yes", "No") != "Yes") + return 1 + + if (!frommob || !tomob) //make sure the mobs don't go away while we waited for a response + return 1 + + tomob.ghostize(0) //boot the old mob out + + 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/login.dm b/code/modules/mob/dead/observer/login.dm index f5b4fedeaea..68b28b360a8 100644 --- a/code/modules/mob/dead/observer/login.dm +++ b/code/modules/mob/dead/observer/login.dm @@ -9,4 +9,14 @@ if(locate(/obj/machinery/computer/cloning, get_step(canclone.loc, dir))) src << 'sound/effects/adminhelp.ogg' src << "Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned! (Verbs -> Ghost -> Re-enter corpse)" - canclone = null \ No newline at end of file + canclone = null + +/mob/dead/observer/MouseDrop(atom/over) + if(!usr || !over) + return + + if (isobserver(usr) && usr.client.holder && isliving(over)) + if (usr.client.holder.cmd_ghost_drag(src,over)) + return + + return ..()