Files
Bubberstation/code/modules/admin/view_variables/admin_delete.dm
MrMelbert 566c7ba9c2 Removes some code soul (IF YOU ARE COPY PASTING THIS...), replaces it with a macro (#79935)
## About The Pull Request

Replaces all instances of `SSblackbox.record_feedback\("tally",
"admin_verb", 1, (.+)\)` with `BLACKBOX_LOG_ADMIN_VERB($1)`

This makes so the funny comment isn't necessary. 

It also reveals one location which someone did not heed the comment, the
`debug_controller` proc copy+pasted the line but did not change the
fourth argument. PEOPLE DON'T READ!
2023-11-26 20:17:04 -07:00

27 lines
841 B
Plaintext

/client/proc/admin_delete(datum/D)
var/atom/A = D
var/coords = ""
var/jmp_coords = ""
if(istype(A))
var/turf/T = get_turf(A)
if(T)
var/atom/a_loc = A.loc
var/is_turf = isturf(a_loc)
coords = "[is_turf ? "at" : "from [a_loc] at"] [AREACOORD(T)]"
jmp_coords = "[is_turf ? "at" : "from [a_loc] at"] [ADMIN_VERBOSEJMP(T)]"
else
jmp_coords = coords = "in nullspace"
if (tgui_alert(usr, "Are you sure you want to delete:\n[D]\n[coords]?", "Confirmation", list("Yes", "No")) == "Yes")
log_admin("[key_name(usr)] deleted [D] [coords]")
message_admins("[key_name_admin(usr)] deleted [D] [jmp_coords]")
BLACKBOX_LOG_ADMIN_VERB("Delete")
if(isturf(D))
var/turf/T = D
T.ScrapeAway()
else
vv_update_display(D, "deleted", VV_MSG_DELETED)
qdel(D)
if(!QDELETED(D))
vv_update_display(D, "deleted", "")