mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Ghost-possession sanity checks.
Adds sanity checks referred to in #8849.
This commit is contained in:
@@ -1256,6 +1256,8 @@ var/global/floorIsLava = 0
|
||||
//*********************************************************************************************************
|
||||
//
|
||||
|
||||
//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
|
||||
@@ -1272,6 +1274,8 @@ var/global/floorIsLava = 0
|
||||
var/ask = alert(question, "Place ghost in control of mob?", "Yes", "No")
|
||||
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)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has put [frommob.ckey] in control of [tomob.name].</span>")
|
||||
|
||||
@@ -484,6 +484,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
|
||||
|
||||
Reference in New Issue
Block a user