mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 10:33:30 +01:00
Admin Ghostdrop sanity checks
Applies tgstation/-tg-station@2227b7a to admin.dm and observer.dm Basically, this adds sanity checks, just to prevent runtimes in the odd case that something happens. For instance, if one of the mobs suddenly gets deleted, this will prevent it from runtiming. Sanity checks.
This commit is contained in:
@@ -988,6 +988,8 @@ proc/formatLocation(var/location)
|
||||
proc/formatPlayerPanel(var/mob/U,var/text="PP")
|
||||
return "<A HREF='?_src_=holder;adminplayeropts=\ref[U]'>[text]</A>"
|
||||
|
||||
//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
|
||||
@@ -999,6 +1001,7 @@ proc/formatPlayerPanel(var/mob/U,var/text="PP")
|
||||
if (!frommob.ckey)
|
||||
return 0
|
||||
|
||||
|
||||
var/question = ""
|
||||
if (tomob.ckey)
|
||||
question = "This mob already has a user ([tomob.key]) in control of it! "
|
||||
@@ -1008,6 +1011,9 @@ proc/formatPlayerPanel(var/mob/U,var/text="PP")
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user