mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Allow admins to drag-drop ghosts into mobs.
This functions the same way as editing the ckey in vv. Has the same permission check as assume-direct-control. It requires the admin also be a ghost to avoid conflicts with other drag drop code.
This commit is contained in:
@@ -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("<span class='adminnotice'>[key_name_admin(usr)] has put [frommob.ckey] in control of [tomob.name].</span>")
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user