mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Allow admins to drag-drop ghosts into mobs
This allows administrators to drag their mouse from a ghost to a type of /mob/living, which will then prompt them if they wish to put that ghost in control of the mob, and obviously, that is exactly what happens if you select yes.
This commit is contained in:
committed by
Tigercat2000
parent
dca6fac85f
commit
f6d4aae74a
@@ -987,3 +987,35 @@ proc/formatLocation(var/location)
|
||||
|
||||
proc/formatPlayerPanel(var/mob/U,var/text="PP")
|
||||
return "<A HREF='?_src_=holder;adminplayeropts=\ref[U]'>[text]</A>"
|
||||
|
||||
/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