Files
Bubberstation/code/modules/admin/view_variables/admin_delete.dm
SkyratBot 84e42fd0eb [MIRROR] Removes some code soul (IF YOU ARE COPY PASTING THIS...), replaces it with a macro [MDB IGNORE] (#25272)
* 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!

* Removes some code soul (`IF YOU ARE COPY PASTING THIS...`), replaces it with a macro

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-11-27 01:02:37 -05:00

35 lines
1.3 KiB
Plaintext

/client/proc/admin_delete(datum/D)
var/atom/A = D
var/coords = ""
var/jmp_coords = ""
var/turf/T // SKYRAT EDIT -- Bluespace sparks on admin delete
if(istype(A))
T = get_turf(A) // SKYRAT EDIT, orginal: 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))
T = D // SKYRAT EDIT, orginal: 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", "")
// Skyrat edit addition start -- optional bluespace sparks on delete
if(T && prefs.read_preference(/datum/preference/toggle/admin/delete_sparks))
playsound(T, 'sound/magic/Repulse.ogg', 100, 1)
var/datum/effect_system/spark_spread/quantum/sparks = new
sparks.set_up(10, 1, T)
sparks.attach(T)
sparks.start()