Add weakref support to qdel (#56171)

qdel() should allow usage of weakrefs to avoid harddels on long duration qdel_in usage
This commit is contained in:
spookydonut
2021-01-16 11:30:40 -05:00
committed by GitHub
parent cc98bcd019
commit 3b3150aa4a
3 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -180,7 +180,7 @@
QDEL_IN(colour, 11)
doomslayer = victim
RegisterSignal(src, COMSIG_PARENT_QDELETING, .proc/end_blood_frenzy)
QDEL_IN(src, duration)
QDEL_IN(WEAKREF(src), duration)
/obj/effect/mine/pickup/bloodbath/proc/end_blood_frenzy()
if(doomslayer)
+1 -1
View File
@@ -87,7 +87,7 @@
add_overlay("hatch")
add_overlay("legs_retracted")
addtimer(CALLBACK(src, .proc/startUp), 50)
QDEL_IN(src, 8 MINUTES) //Self-destruct after 8 min
QDEL_IN(WEAKREF(src), 8 MINUTES) //Self-destruct after 8 min
SSeconomy.market_crashing = TRUE