More hard dels tracking (#37654)

This commit is contained in:
ShiftyRail
2025-06-02 13:48:03 +01:00
committed by GitHub
parent 1c0bc3a4de
commit 04374cc2c2
9 changed files with 35 additions and 9 deletions

View File

@@ -10,6 +10,12 @@
/datum/malfhack_ability/New(var/obj/machinery/M)
machine = M
/datum/malfhack_ability/Destroy()
if (machine) // In case we got destroyed but the machine wasn't, this can happen in edge cases.
machine.hack_abilities -= src
machine = null
. = ..()
/datum/malfhack_ability/proc/activate(var/mob/living/silicon/A)
var/datum/role/malfAI/M = A.mind.GetRole(MALF)
if(!istype(A) || !istype(M))

View File

@@ -9,7 +9,7 @@
var/malf_disrupted = FALSE
var/aicontrolbypass = FALSE
var/hack_abilities = list(
var/list/hack_abilities = list(
/datum/malfhack_ability/toggle/disable,
/datum/malfhack_ability/oneuse/overload_quiet
)

View File

@@ -76,9 +76,6 @@
if (isturf(loc) && opacity)
T = loc
T.reconsider_lights()
var/turf/simulated/S = get_turf(src)
if (istype(S))
S.zone?.burnable_atoms -= src
if(materials)
QDEL_NULL(materials)
@@ -98,6 +95,9 @@
break_all_tethers()
for(var/atom/movable/AM in src)
qdel(AM)
forceMove(null, harderforce = TRUE)
if (T)
@@ -106,9 +106,6 @@
if(virtualhearer)
QDEL_NULL(virtualhearer)
for(var/atom/movable/AM in src)
qdel(AM)
. = ..()
/atom/movable/Del()
@@ -482,6 +479,12 @@
var/list/atom/old_locs = locs //locs is implicitly copied on assignment, not aliased
var/atom/old_loc = loc //Just for convenience; should be equivalent to old_locs[1].
var/list/atom/uncrossing
if (destination == null)
var/turf/simulated/S = get_turf(old_loc)
if (istype(S))
S.zone?.burnable_atoms -= src
if(isturf(loc)) //obounds() provides nonsense results when Ref.loc isn't a turf.
uncrossing = obounds(src)
else

View File

@@ -208,6 +208,7 @@ Class Procs:
for(var/datum/malfhack_ability/MH in hack_abilities)
MH.machine = null
qdel(MH)
hack_abilities = null
qdel(hack_overlay)
..()

View File

@@ -31,6 +31,10 @@
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
initialize()
/obj/item/radio/integrated/signal/Destroy()
radio_controller.remove_object(src, frequency)
. = ..()
/obj/item/radio/integrated/signal/initialize()
if (!radio_controller)
return

View File

@@ -35,7 +35,6 @@
/obj/item/stack/Destroy()
if (usr && usr.machine==src)
usr << browse(null, "window=stack")
src.forceMove(null)
..()
/obj/item/stack/examine(mob/user)

View File

@@ -132,11 +132,14 @@ var/creating_arena = FALSE
..()
/mob/dead/observer/Destroy()
..()
var/datum/gamemode/dynamic/dyn_mode = ticker.mode
if (istype(dyn_mode))
dyn_mode.dead_players -= src
unregister_event(/event/after_move, src, nameof(src::update_holomaps()))
QDEL_NULL(station_holomap)
ghostMulti = null
observers.Remove(src)
return ..()
/mob/dead/observer/proc/update_holomaps()
if(station_holomap)

View File

@@ -26,6 +26,11 @@
if(addicted_chems)
QDEL_NULL(addicted_chems)
var/datum/gamemode/dynamic/dyn_mode = ticker.mode
if (istype(dyn_mode))
dyn_mode.living_players -= src
. = ..()
/mob/living/examine(var/mob/user, var/size = "", var/show_name = TRUE, var/show_icon = TRUE) //Show the mob's size and whether it's been butchered

View File

@@ -53,6 +53,11 @@
attack_delayer = null
special_delayer = null
throw_delayer = null
dark_plane = null
self_vision = null
master_plane = null
QDEL_NULL(hud_used)
for(var/atom/movable/leftovers in src)
qdel(leftovers)