[MIRROR] [s] Cleanup escalation unsafe procs [MDB IGNORE] (#8642)

* [s] Cleanup escalation unsafe procs (#61905)

Fixes admins spawning in atoms and datums without the DF_VAR_EDITED flag

* [s] Cleanup escalation unsafe procs

Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-10-06 20:36:27 +02:00
committed by GitHub
parent a2125e3215
commit fc29da4e9c
6 changed files with 14 additions and 8 deletions
-1
View File
@@ -2,4 +2,3 @@
/// A shorthand for the callback datum, [documented here](datum/callback.html)
#define CALLBACK new /datum/callback
#define INVOKE_ASYNC world.ImmediateInvokeAsync
#define CALLBACK_NEW(typepath, args) CALLBACK(GLOBAL_PROC, /proc/___callbacknew, typepath, args)
-3
View File
@@ -220,6 +220,3 @@
while(CS.pendingcount)
sleep(resolution*world.tick_lag)
return CS.finished
/proc/___callbacknew(typepath, arguments)
new typepath(arglist(arguments))
+3
View File
@@ -13,6 +13,9 @@ GLOBAL_LIST_EMPTY(active_alternate_appearances)
return
if(alternate_appearances && alternate_appearances[key])
return
if(!ispath(type, /datum/atom_hud/alternate_appearance))
CRASH("Invalid type passed in: [type]")
var/list/arguments = args.Copy(2)
return new type(arglist(arguments))
@@ -85,7 +85,10 @@
return min(arglist(args))
/proc/_new(type, arguments)
return new type (arglist(arguments))
var/datum/result = new type(arglist(arguments))
if(istype(result))
result.datum_flags |= DF_VAR_EDITED
return result
/proc/_num2text(N, SigFig = 6)
return num2text(N, SigFig)
+4 -2
View File
@@ -489,11 +489,13 @@ BLIND // can't see anything
return 1
return 0
/obj/item/clothing/proc/_spawn_shreds()
new /obj/effect/decal/cleanable/shreds(get_turf(src), name)
/obj/item/clothing/atom_destruction(damage_flag)
if(damage_flag == BOMB)
var/turf/T = get_turf(src)
//so the shred survives potential turf change from the explosion.
addtimer(CALLBACK_NEW(/obj/effect/decal/cleanable/shreds, list(T, name)), 1)
addtimer(CALLBACK(src, .proc/_spawn_shreds), 1)
deconstruct(FALSE)
if(damage_flag == CONSUME) //This allows for moths to fully consume clothing, rather than damaging it like other sources like brute
var/turf/current_position = get_turf(src)
@@ -40,4 +40,6 @@
params.Insert(1, spawn_at.value)
spawned_atom.set_output(new typepath(arglist(params)))
var/atom/spawned = new typepath(arglist(params))
spawned.datum_flags |= DF_VAR_EDITED
spawned_atom.set_output(spawned)