Improper forced qdel cleanup, some expanded del all verbs (#66595)

* Removes all supurfolus uses of QDEL_HINT_LETMELIVE

This define exists to allow abstract, sturucturally important things to
opt out of being qdeleted.
It does not exist to be a "Immune to everything" get out of jail free
card.
We have systems for this, and it's not appropriate here.

This change is inherently breaking, because things might be improperly
qdeling these things. Those issues will need to be resolved in future,
as they pop up

* Changes all needless uses of COMSIG_PARENT_PREQDELETED

It exists for things that want to block the qdel. If that's not you,
don't use it

* Adds force and hard del verbs, for chip and break glass cases
respectively

The harddel verb comes with two options before it's run, to let you
tailor it to your level of fucked

* Damn you nova

Adds proper parent returns instead of . = ..()

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>

* Ensures immortality talismans cannot delete their human if something goes fuckey. Thanks ath/oro for pointing this out

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
This commit is contained in:
LemonInTheDark
2022-05-06 17:52:45 -07:00
committed by GitHub
parent d61fa9df81
commit 0504c0a2b4
20 changed files with 153 additions and 98 deletions
+23 -16
View File
@@ -380,13 +380,32 @@
icon_state = "blank"
icon = 'icons/effects/effects.dmi'
var/vanish_description = "vanishes from reality"
var/can_destroy = TRUE
// Weakref to the user who we're "acting" on
var/datum/weakref/user_ref
/obj/effect/immortality_talisman/Initialize(mapload, mob/new_user)
. = ..()
if(new_user)
vanish(new_user)
/obj/effect/immortality_talisman/Destroy()
// If we have a mob, we need to free it before cleanup
// This is a safety to prevent nuking a human, not so much a good pattern in general
unvanish()
return ..()
/obj/effect/immortality_talisman/proc/unvanish()
var/mob/user = user_ref?.resolve()
user_ref = null
if(!user)
return
user.status_flags &= ~GODMODE
user.notransform = FALSE
user.forceMove(get_turf(src))
user.visible_message(span_danger("[user] pops back into reality!"))
/obj/effect/immortality_talisman/proc/vanish(mob/user)
user.visible_message(span_danger("[user] [vanish_description], leaving a hole in [user.p_their()] place!"))
@@ -397,17 +416,11 @@
user.notransform = TRUE
user.status_flags |= GODMODE
can_destroy = FALSE
user_ref = WEAKREF(user)
addtimer(CALLBACK(src, .proc/unvanish, user), 10 SECONDS)
addtimer(CALLBACK(src, .proc/dissipate), 10 SECONDS)
/obj/effect/immortality_talisman/proc/unvanish(mob/user)
user.status_flags &= ~GODMODE
user.notransform = FALSE
user.forceMove(get_turf(src))
user.visible_message(span_danger("[user] pops back into reality!"))
can_destroy = TRUE
/obj/effect/immortality_talisman/proc/dissipate()
qdel(src)
/obj/effect/immortality_talisman/attackby()
@@ -416,12 +429,6 @@
/obj/effect/immortality_talisman/singularity_pull()
return
/obj/effect/immortality_talisman/Destroy(force)
if(!can_destroy && !force)
return QDEL_HINT_LETMELIVE
else
. = ..()
/obj/effect/immortality_talisman/void
vanish_description = "is dragged into the void"