Fixes #1528 + hard delete for admins (#1534)

This commit is contained in:
skull132
2017-01-12 16:19:17 +02:00
committed by GitHub
parent 0b5fdba52d
commit 9ae619d02e
3 changed files with 37 additions and 13 deletions

View File

@@ -591,7 +591,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
src << "Only administrators may use this command."
return
if (alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes")
var/action = alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No", "Hard Delete")
if (action == "No")
return
if (istype(O, /mob/dead/observer))
var/mob/dead/observer/M = O
if (M.client && alert(src, "They are still connected. Are you sure, they will loose connection.", "Confirmation", "Yes", "No") != "Yes")
@@ -599,7 +603,12 @@ Traitors and the like can also be revived with the previous role mostly intact.
log_admin("[key_name(usr)] deleted [O] at ([O.x],[O.y],[O.z])")
message_admins("[key_name_admin(usr)] deleted [O] at ([O.x],[O.y],[O.z])", 1)
feedback_add_details("admin_verb","DEL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if (action == "Yes")
qdel(O)
else
// This is naughty, but sometimes necessary.
del(O)
/client/proc/cmd_admin_list_open_jobs()
set category = "Admin"

View File

@@ -173,7 +173,8 @@
if(action_type == "Cancel" || !action_type)
return
if(alert("Are you really sure you want to delete all objects of type [O.type]?",,"Yes","No") != "Yes")
var/del_action = alert("Are you really sure you want to delete all objects of type [O.type]?",,"Yes","No", "Hard Delete")
if(del_action == "No")
return
if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes")
@@ -186,6 +187,9 @@
for(var/obj/Obj in world)
if(Obj.type == O_type)
i++
if (del_action == "Hard Delete")
del(Obj)
else
qdel(Obj)
if(!i)
usr << "No objects of this type exist"
@@ -197,6 +201,9 @@
for(var/obj/Obj in world)
if(istype(Obj,O_type))
i++
if (del_action == "Hard Delete")
del(Obj)
else
qdel(Obj)
if(!i)
usr << "No objects of this type exist"

View File

@@ -34,8 +34,11 @@
return ..(loc)
/obj/effect/blob/Destroy()
processing_objects.Remove(src)
// Sanity time.
if (parent_core)
parent_core.blob_count -= 1
parent_core = null
..()
/obj/effect/blob/process()
@@ -45,6 +48,11 @@
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
return
// Make deleting the parent more responsive.
if(!isnull(parent_core.gcDestroyed))
parent_core = null
return
if(prob(70))
for(var/mob/living/L in src.loc)
if(L.stat == DEAD)