From e4192f9b8f9d703c34394dce1cfb829808c54bda Mon Sep 17 00:00:00 2001 From: Wildkins Date: Fri, 20 Feb 2026 20:41:50 -0500 Subject: [PATCH] Lag War Day 5.5: are you serious dude (#21889) we have a gorillion hard deletions and it turns out half of them are because we set the "ALWAYS HARD DELETE THIS" flag rather than just like. fixing the hard delete. cool --- code/__DEFINES/qdel.dm | 11 ---------- code/_onclick/hud/screen_objects.dm | 2 ++ code/controllers/subsystems/ghostroles.dm | 1 + code/datums/components/eye/_eye.dm | 4 ++-- code/datums/outfits/outfit.dm | 2 ++ code/game/machinery/camera/camera.dm | 1 - .../airlock_controllers.dm | 4 ---- .../embedded_controller_base.dm | 1 - .../embedded_program_base.dm | 21 +++++++++++++++---- .../objects/effects/explosion_particles.dm | 4 ---- .../objects/items/devices/radio/headset.dm | 1 - .../game/objects/items/devices/radio/radio.dm | 1 - code/game/objects/items/stacks/rods.dm | 1 - code/game/objects/items/weapons/cards_ids.dm | 1 - .../items/weapons/cards_ids_syndicate.dm | 4 +++- .../objects/items/weapons/material/shards.dm | 4 ---- code/game/objects/random/loot.dm | 1 + .../components/omni_devices/_omni_extras.dm | 8 +++++++ .../components/omni_devices/filter.dm | 1 + .../components/omni_devices/mixer.dm | 1 + .../components/omni_devices/omni_base.dm | 8 +------ code/modules/ghostroles/spawner/base.dm | 5 +++++ code/modules/materials/material_sheets.dm | 1 - code/modules/mob/abstract/freelook/ai/eye.dm | 4 ++++ .../mob/abstract/freelook/visualnet.dm | 4 ++-- .../living/carbon/alien/diona/diona_nymph.dm | 1 - .../mob/living/simple_animal/friendly/carp.dm | 3 ++- .../mob/living/simple_animal/friendly/cat.dm | 17 +++++++++++++-- .../living/simple_animal/friendly/corgi.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 16 ++++++++------ code/modules/mob/living/simple_animal/worm.dm | 9 ++++++++ code/modules/mob/mob_grab.dm | 8 ++++++- .../computers/subtypes/dev_silicon.dm | 4 ++-- .../file_system/computer_file.dm | 2 +- .../modular_computers/hardware/hard_drive.dm | 8 +++---- .../hardware/portable_hard_drive.dm | 6 ++++-- .../hardware/portable_hard_drive_presets.dm | 4 ---- code/modules/shuttles/escape_pods.dm | 18 +++++++++++++++- html/changelogs/johnwildkins-awnaw.yml | 12 +++++++++++ 39 files changed, 133 insertions(+), 73 deletions(-) create mode 100644 html/changelogs/johnwildkins-awnaw.yml diff --git a/code/__DEFINES/qdel.dm b/code/__DEFINES/qdel.dm index b0cbb3e2597..abc0cfc7ba0 100644 --- a/code/__DEFINES/qdel.dm +++ b/code/__DEFINES/qdel.dm @@ -1,14 +1,3 @@ -/** - * THIS IS A TEMPORARY WORKAROUND WHILE WE RESOLVE HARDDELS WITH THE NEW GC - * - * YOU ARE ONLY ALLOWED TO REMOVE THE AMOUNT OF THEM, NOT ADD MORE - * - * AND FOR WHAT MATTERS, THE SAME GOES FOR QDEL_HINT_HARDDEL, - * I DO NOT CARE HOW MANY REWRITES AND REFACTORS YOU HAVE TO DO, WHATEVER YOU ADD NEEDS TO BE GARGAGE COLLECTABLE, OR HAVE AN EXPLAINED, CLEAR, UNFIXABLE REASON WHY IT IS NOT - * - */ -#define GC_TEMPORARY_HARDDEL return QDEL_HINT_HARDDEL - //! Defines that give qdel hints. //! //! These can be given as a return in [/atom/proc/Destroy] or by calling [/proc/qdel]. diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 1a4c5a2dac3..d0a1c6916b1 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -26,6 +26,8 @@ /atom/movable/screen/Destroy(force = FALSE) master = null screen_loc = null + if(hud?.mymob?.client) + hud.mymob.client.screen -= src hud = null . = ..() diff --git a/code/controllers/subsystems/ghostroles.dm b/code/controllers/subsystems/ghostroles.dm index 96fee090acc..f1404e5b237 100644 --- a/code/controllers/subsystems/ghostroles.dm +++ b/code/controllers/subsystems/ghostroles.dm @@ -265,6 +265,7 @@ SUBSYSTEM_DEF(ghostroles) var/datum/ghostspawner/G = spawners[ghost_role_name] if(G && !(spawn_atom in G.spawn_atoms)) G.spawn_atoms += spawn_atom + G.RegisterSignal(spawn_atom, COMSIG_QDELETING, TYPE_PROC_REF(/datum/ghostspawner, spawn_atom_deleted)) if(G.atom_add_message) say_dead_direct("[G.atom_add_message]
Spawn in as it by using the ghost spawner menu in the ghost tab, and try to be good!") diff --git a/code/datums/components/eye/_eye.dm b/code/datums/components/eye/_eye.dm index 1847caf1c7b..17d73539fdd 100644 --- a/code/datums/components/eye/_eye.dm +++ b/code/datums/components/eye/_eye.dm @@ -46,7 +46,7 @@ RegisterSignal(component_eye, COMSIG_QDELETING, PROC_REF(unlook)) RegisterSignal(current_looker, COMSIG_MOB_LOGOUT, PROC_REF(unlook)) - RegisterSignal(current_looker, COMSIG_GLOB_MOB_DEATH, PROC_REF(unlook)) + RegisterSignal(SSdcs, COMSIG_GLOB_MOB_DEATH, PROC_REF(unlook)) return TRUE @@ -63,7 +63,7 @@ UnregisterSignal(current_looker, COMSIG_MOVABLE_MOVED) UnregisterSignal(current_looker, COMSIG_QDELETING) UnregisterSignal(current_looker, COMSIG_MOB_LOGOUT) - UnregisterSignal(current_looker, COMSIG_GLOB_MOB_DEATH) + UnregisterSignal(SSdcs, COMSIG_GLOB_MOB_DEATH) if(current_looker.client) current_looker.client.eye = current_looker current_looker.eyeobj = null diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm index b7051e9a607..b9e740c30ab 100644 --- a/code/datums/outfits/outfit.dm +++ b/code/datums/outfits/outfit.dm @@ -633,6 +633,8 @@ H.gloves.add_fingerprint(H, 1) if(H.wrists) H.wrists.add_fingerprint(H, 1) + if(H.pants) + H.pants.add_fingerprint(H, 1) if(H.l_ear) H.l_ear.add_fingerprint(H, 1) if(H.r_ear) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 0e1477799fa..b3201c4f0ef 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -90,7 +90,6 @@ GLOB.cameranet.remove_source(src) . = ..() - GC_TEMPORARY_HARDDEL /obj/machinery/camera/set_pixel_offsets() pixel_x = dir & (NORTH|SOUTH) ? 0 : (dir == EAST ? -13 : 13) diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm index 0f72c9810ef..1c4aa630722 100644 --- a/code/game/machinery/embedded_controller/airlock_controllers.dm +++ b/code/game/machinery/embedded_controller/airlock_controllers.dm @@ -33,10 +33,6 @@ tag_chamber_sensor = given_tag_chamber_sensor program = new /datum/computer/file/embedded_program/airlock(src) -/obj/machinery/embedded_controller/radio/airlock/Destroy() - . = ..() - GC_TEMPORARY_HARDDEL - /obj/machinery/embedded_controller/radio/airlock/attackby(obj/item/attacking_item, mob/user) //Swiping ID on the access button if (attacking_item.GetID()) diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index a1801ea9341..a2147a0cc01 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -13,7 +13,6 @@ if(SSradio) SSradio.remove_object(src,frequency) . = ..() - GC_TEMPORARY_HARDDEL /obj/machinery/embedded_controller/proc/post_signal(datum/signal/signal, comm_line) return 0 diff --git a/code/game/machinery/embedded_controller/embedded_program_base.dm b/code/game/machinery/embedded_controller/embedded_program_base.dm index 2a75090ea5c..13da2b0ab42 100644 --- a/code/game/machinery/embedded_controller/embedded_program_base.dm +++ b/code/game/machinery/embedded_controller/embedded_program_base.dm @@ -6,10 +6,23 @@ var/id_tag /datum/computer/file/embedded_program/New(var/obj/machinery/embedded_controller/M) - master = M - if (istype(M, /obj/machinery/embedded_controller/radio)) - var/obj/machinery/embedded_controller/radio/R = M - id_tag = R.id_tag + set_master(M) + +/datum/computer/file/embedded_program/proc/set_master(obj/machinery/embedded_controller/new_master) + if(new_master && master != new_master) + master = new_master + id_tag = astype(new_master, /obj/machinery/embedded_controller/radio)?.id_tag + RegisterSignal(master, COMSIG_QDELETING, PROC_REF(unset_master)) + +/datum/computer/file/embedded_program/proc/unset_master() + if(master) + UnregisterSignal(master, COMSIG_QDELETING) + master = null + id_tag = null + +/datum/computer/file/embedded_program/Destroy(force) + master = null + . = ..() /datum/computer/file/embedded_program/proc/receive_user_command(command) return diff --git a/code/game/objects/effects/explosion_particles.dm b/code/game/objects/effects/explosion_particles.dm index cc18ad1150f..893e9ce7875 100644 --- a/code/game/objects/effects/explosion_particles.dm +++ b/code/game/objects/effects/explosion_particles.dm @@ -15,10 +15,6 @@ . = ..() return -/obj/effect/expl_particles/Destroy() - . = ..() - GC_TEMPORARY_HARDDEL - /datum/effect/system/expl_particles var/number = 10 var/turf/location diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index fb30e4db301..1b3e863805f 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -1042,7 +1042,6 @@ /obj/item/radio/headset/heads/ai_integrated/Destroy() myAi = null . = ..() - GC_TEMPORARY_HARDDEL /obj/item/radio/headset/heads/ai_integrated/can_receive(input_frequency, level) return ..(input_frequency, level, !disabledAi) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 80aba18fdcb..fae5ed34135 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -586,7 +586,6 @@ var/global/list/default_interrogation_channels = list( /obj/item/radio/borg/Destroy() myborg = null . = ..() - GC_TEMPORARY_HARDDEL /obj/item/radio/borg/list_channels(var/mob/user) return list_secure_channels(user) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 05bda089c0b..af840e5f426 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -50,7 +50,6 @@ GLOBAL_LIST_INIT_TYPED(rod_recipes, /datum/stack_recipe, list( /obj/item/stack/rods/Destroy() . = ..() - GC_TEMPORARY_HARDDEL /obj/item/stack/rods/full/Initialize() . = ..() diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 1d239dbe11a..3a5dd35cd5c 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -184,7 +184,6 @@ QDEL_NULL(chat_user) mob_id = null . = ..() - GC_TEMPORARY_HARDDEL /obj/item/card/id/examine(mob/user, distance, is_adjacent, infix, suffix, show_extended) . = ..() diff --git a/code/game/objects/items/weapons/cards_ids_syndicate.dm b/code/game/objects/items/weapons/cards_ids_syndicate.dm index 2351e5ceb3e..04dc7249b9a 100644 --- a/code/game/objects/items/weapons/cards_ids_syndicate.dm +++ b/code/game/objects/items/weapons/cards_ids_syndicate.dm @@ -45,7 +45,9 @@ /obj/item/card/id/syndicate/Destroy() STOP_PROCESSING(SSprocessing, src) - unset_registered_user(registered_user) + if(registered_user) + UnregisterSignal(registered_user, COMSIG_QDELETING) + registered_user = null return ..() /obj/item/card/id/syndicate/process() diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index af0da44df47..2303abaf704 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -29,10 +29,6 @@ AddElement(/datum/element/connect_loc, loc_connections) -/obj/item/material/shard/Destroy() - . = ..() - GC_TEMPORARY_HARDDEL - /obj/item/material/shard/set_material(var/new_material) ..(new_material) if(!istype(material)) diff --git a/code/game/objects/random/loot.dm b/code/game/objects/random/loot.dm index 95614cbfd74..fc2e123e91b 100644 --- a/code/game/objects/random/loot.dm +++ b/code/game/objects/random/loot.dm @@ -567,6 +567,7 @@ var/to_delete = rand(1, length(AG.stored_ammo)) var/delete_counter = 0 for(var/obj/item/ammo_casing/AC in AG.stored_ammo) + AG.stored_ammo -= AC qdel(AC) delete_counter++ if(delete_counter > to_delete) diff --git a/code/modules/atmospherics/components/omni_devices/_omni_extras.dm b/code/modules/atmospherics/components/omni_devices/_omni_extras.dm index 2e8c0283939..9592639782e 100644 --- a/code/modules/atmospherics/components/omni_devices/_omni_extras.dm +++ b/code/modules/atmospherics/components/omni_devices/_omni_extras.dm @@ -46,6 +46,14 @@ air = new air.volume = 200 +/datum/omni_port/Destroy(force) + if(node) + disconnect() + QDEL_NULL(network) + node = null + master = null + . = ..() + /datum/omni_port/proc/connect() if(node) return diff --git a/code/modules/atmospherics/components/omni_devices/filter.dm b/code/modules/atmospherics/components/omni_devices/filter.dm index 1b566d39637..04795c08c60 100644 --- a/code/modules/atmospherics/components/omni_devices/filter.dm +++ b/code/modules/atmospherics/components/omni_devices/filter.dm @@ -30,6 +30,7 @@ P.air.volume = ATMOS_DEFAULT_VOLUME_FILTER /obj/machinery/atmospherics/omni/filter/Destroy() + // these get qdel'd in omni/Destroy() input = null output = null active_filters.Cut() diff --git a/code/modules/atmospherics/components/omni_devices/mixer.dm b/code/modules/atmospherics/components/omni_devices/mixer.dm index 2640168dd6b..215c8ad3971 100644 --- a/code/modules/atmospherics/components/omni_devices/mixer.dm +++ b/code/modules/atmospherics/components/omni_devices/mixer.dm @@ -56,6 +56,7 @@ /obj/machinery/atmospherics/omni/mixer/Destroy() inputs.Cut() + // this gets qdel'd in omni/Destroy() output = null return ..() diff --git a/code/modules/atmospherics/components/omni_devices/omni_base.dm b/code/modules/atmospherics/components/omni_devices/omni_base.dm index 043a241e100..d587883d4ae 100644 --- a/code/modules/atmospherics/components/omni_devices/omni_base.dm +++ b/code/modules/atmospherics/components/omni_devices/omni_base.dm @@ -212,15 +212,9 @@ /obj/machinery/atmospherics/omni/Destroy() loc = null - - for(var/datum/omni_port/P in ports) - if(P.node) - P.node.disconnect(src) - qdel(P.network) - P.node = null + QDEL_LIST(ports) . = ..() - GC_TEMPORARY_HARDDEL /obj/machinery/atmospherics/omni/atmos_init() for(var/datum/omni_port/P in ports) diff --git a/code/modules/ghostroles/spawner/base.dm b/code/modules/ghostroles/spawner/base.dm index 3cd6583ba00..69984f8fefe 100644 --- a/code/modules/ghostroles/spawner/base.dm +++ b/code/modules/ghostroles/spawner/base.dm @@ -77,6 +77,11 @@ if(!isnull(enable_chance)) enabled = prob(enable_chance) +/datum/ghostspawner/proc/spawn_atom_deleted(atom/spawn_atom) + SIGNAL_HANDLER + spawn_atoms -= spawn_atom + UnregisterSignal(spawn_atom, COMSIG_QDELETING) + //Return a error message if the user CANT see the ghost spawner. Otherwise FALSE /datum/ghostspawner/proc/cant_see(mob/user) //If the user can see the spawner in the menu if(req_perms) //Only those with the correct flags can see restricted roles diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index f30672082e1..48a3ce8e72a 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -317,7 +317,6 @@ /obj/item/stack/material/plasteel/Destroy() . = ..() - GC_TEMPORARY_HARDDEL /obj/item/stack/material/plasteel/full/Initialize() . = ..() diff --git a/code/modules/mob/abstract/freelook/ai/eye.dm b/code/modules/mob/abstract/freelook/ai/eye.dm index 5bb99282f4c..c2c5bbabe7d 100644 --- a/code/modules/mob/abstract/freelook/ai/eye.dm +++ b/code/modules/mob/abstract/freelook/ai/eye.dm @@ -10,6 +10,10 @@ . = ..() visualnet = GLOB.cameranet +/mob/abstract/eye/freelook/Destroy() + visualnet = null + . = ..() + /datum/click_handler/eye/freelook/OnDblClick(atom/A, params) var/mob/abstract/eye = user.eyeobj if(!eye) //Something has broken, ensure the click handler doesn't stick around diff --git a/code/modules/mob/abstract/freelook/visualnet.dm b/code/modules/mob/abstract/freelook/visualnet.dm index 4df284e4923..48f77780992 100644 --- a/code/modules/mob/abstract/freelook/visualnet.dm +++ b/code/modules/mob/abstract/freelook/visualnet.dm @@ -75,8 +75,8 @@ c.add_eye(eye) /datum/visualnet/proc/remove_eye(mob/abstract/eye/freelook/eye) - for(var/chunk in eye.visibleChunks) - var/datum/chunk/c = chunk + for(var/chunk in chunks) + var/datum/chunk/c = chunks[chunk] c.remove_eye(eye) // Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open. diff --git a/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm b/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm index 7f0d7acdaf3..12b25d1bbab 100644 --- a/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm +++ b/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm @@ -91,7 +91,6 @@ ClearOverlays() . = ..() - GC_TEMPORARY_HARDDEL /mob/living/carbon/alien/diona/get_ingested_reagents() return ingested diff --git a/code/modules/mob/living/simple_animal/friendly/carp.dm b/code/modules/mob/living/simple_animal/friendly/carp.dm index 1bcb14b6cb5..c3555d2079b 100644 --- a/code/modules/mob/living/simple_animal/friendly/carp.dm +++ b/code/modules/mob/living/simple_animal/friendly/carp.dm @@ -101,12 +101,13 @@ //walk to friend stop_automated_movement = 1 movement_target = friend + RegisterSignal(movement_target, COMSIG_QDELETING, PROC_REF(lostMovementTarget)) GLOB.move_manager.move_to(src, movement_target, near_dist, seek_move_delay) //already following and close enough, stop else if(current_dist <= near_dist) GLOB.move_manager.stop_looping(src) - movement_target = null + lostMovementTarget() stop_automated_movement = 0 if(prob(10)) say("Glub!") diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index e313e0cdb80..0cef2f3c4ec 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -47,14 +47,27 @@ . = ..() src.filters += filter(type="drop_shadow", size = 2, offset = 2, color = rgb(0,208,0,0)) +/mob/living/simple_animal/cat/Destroy() + lost_rattarget() + return ..() + +/mob/living/simple_animal/cat/proc/lost_rattarget() + if(rattarget) + UnregisterSignal(rattarget, COMSIG_QDELETING) + rattarget = null + /mob/living/simple_animal/cat/think() //MICE! ..() if (!stat) for(var/mob/living/simple_animal/rat/snack in oview(src,7)) if(snack.stat != DEAD && prob(65))//The probability allows her to not get stuck target the first rat, reducing exploits + if(rattarget) // fr? + UnregisterSignal(rattarget, COMSIG_QDELETING) rattarget = snack movement_target = snack + RegisterSignal(rattarget, COMSIG_QDELETING, PROC_REF(lost_rattarget)) + RegisterSignal(movement_target, COMSIG_QDELETING, PROC_REF(lostMovementTarget)) if(prob(15)) audible_emote(pick("hisses and spits!","mrowls fiercely!","eyes [snack] hungrily.")) @@ -94,7 +107,7 @@ if(M.stat != DEAD) M.splat() visible_emote(pick("bites \the [M]!","toys with \the [M].","chomps on \the [M]!"),0) - movement_target = null + lostMovementTarget() stop_automated_movement = 0 if (prob(75)) break//usually only kill one rat per proc @@ -229,7 +242,7 @@ //already following and close enough, stop else if (current_dist <= near_dist) GLOB.move_manager.stop_looping(src) - movement_target = null + lostMovementTarget() stop_automated_movement = 0 if (prob(10)) say("Meow!") diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 09b0a3b69e7..a94c4ed4c9c 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -79,7 +79,7 @@ SPAN_ALERT("[user] baps you on the nose with the rolled up [attacking_item.name]!") ) scan_interval = max_scan_interval - movement_target = null + lostMovementTarget() stop_automated_movement = 0 turns_since_scan = 0 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index f592b13f6c2..ab672e02204 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -251,11 +251,15 @@ /mob/living/simple_animal/Destroy() CutOverlays(blood_overlay) - movement_target = null + lostMovementTarget() QDEL_NULL(udder) . = ..() - GC_TEMPORARY_HARDDEL + +/mob/living/simple_animal/proc/lostMovementTarget() + if(movement_target) + UnregisterSignal(movement_target, COMSIG_QDELETING) + movement_target = null /mob/living/simple_animal/Move(NewLoc, direct) // this is a janky way to prevent mobs wandering into chasms, but allows them to be thrown into it by someone else if the mob is dead @@ -754,11 +758,11 @@ /mob/living/simple_animal/cat/proc/handle_movement_target() //if our target is neither inside a turf or inside a human(???), stop if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) )) - movement_target = null + lostMovementTarget() stop_automated_movement = 0 //if we have no target or our current one is out of sight/too far away if( !movement_target || !(movement_target.loc in oview(src, 4)) ) - movement_target = null + lostMovementTarget() stop_automated_movement = 0 if(movement_target) @@ -779,7 +783,7 @@ /mob/living/simple_animal/death(gibbed, deathmessage = "dies!") GLOB.move_manager.stop_looping(src) - movement_target = null + lostMovementTarget() ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_MOB_DEATH) if (isopenturf(loc)) ADD_FALLING_ATOM(src) @@ -945,7 +949,7 @@ canmove = 0 wander = 0 GLOB.move_manager.stop_looping(src) - movement_target = null + lostMovementTarget() update_icon() /// Wakes the mob up from sleeping diff --git a/code/modules/mob/living/simple_animal/worm.dm b/code/modules/mob/living/simple_animal/worm.dm index 8848f18b18c..60e49ee0762 100644 --- a/code/modules/mob/living/simple_animal/worm.dm +++ b/code/modules/mob/living/simple_animal/worm.dm @@ -69,6 +69,10 @@ /mob/living/simple_animal/space_worm/Destroy() //if a chunk a destroyed, make a new worm out of the split halves if(previous) previous.Detach() + if(next && next.previous == src) + next.previous = null + previous = null + next = null return ..() /mob/living/simple_animal/space_worm/Move() @@ -127,6 +131,11 @@ return /mob/living/simple_animal/space_worm/proc/Detach(die = 0) + if(QDELETED(src)) + previous = null + next = null + return + var/mob/living/simple_animal/space_worm/newHead = new /mob/living/simple_animal/space_worm/head(loc,0) var/mob/living/simple_animal/space_worm/newHeadPrevious = previous diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index b9f92f70896..d77c6830c27 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -408,7 +408,7 @@ /obj/item/grab/Destroy() if(!QDELETED(linked_grab)) - qdel(linked_grab) + QDEL_NULL(linked_grab) UnregisterSignal(assailant, COMSIG_MOB_ZONE_SEL_CHANGE) @@ -513,6 +513,12 @@ linked.linked_grab = src linked_grab.set_wielding() +/obj/item/grab/offhand/Destroy() + if(linked_grab) + linked_grab.linked_grab = null + linked_grab.wielded = FALSE + . = ..() + /obj/item/grab/offhand/process() return diff --git a/code/modules/modular_computers/computers/subtypes/dev_silicon.dm b/code/modules/modular_computers/computers/subtypes/dev_silicon.dm index 23419091b60..31bc55dd425 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_silicon.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_silicon.dm @@ -60,7 +60,7 @@ hard_drive.store_file(new /datum/computer_file/program/atmos_control(src)) hard_drive.store_file(new /datum/computer_file/program/rcon_console(src)) hard_drive.store_file(new /datum/computer_file/program/law_manager(src, computer_host)) - hard_drive.remove_file(hard_drive.find_file_by_name("clientmanager")) + hard_drive.remove_file(hard_drive.find_file_by_name("clientmanager"), TRUE) addtimer(CALLBACK(src, PROC_REF(register_chat)), 1 SECOND) /obj/item/modular_computer/silicon/proc/register_chat() @@ -72,4 +72,4 @@ hard_drive.store_file(new /datum/computer_file/program/filemanager(src)) hard_drive.store_file(new /datum/computer_file/program/ntnetdownload(src)) hard_drive.store_file(new /datum/computer_file/program/alarm_monitor/all(src)) - hard_drive.remove_file(hard_drive.find_file_by_name("clientmanager")) + hard_drive.remove_file(hard_drive.find_file_by_name("clientmanager"), TRUE) diff --git a/code/modules/modular_computers/file_system/computer_file.dm b/code/modules/modular_computers/file_system/computer_file.dm index 4684bb3ad09..527ce2161bd 100644 --- a/code/modules/modular_computers/file_system/computer_file.dm +++ b/code/modules/modular_computers/file_system/computer_file.dm @@ -28,7 +28,7 @@ GLOBAL_VAR_INIT(file_uid, 0) if(!hard_drive) return ..() - hard_drive.remove_file(src) + hard_drive.remove_file(src, TRUE) // hard_drive.hard_drive is the computer that has drive installed. If we are Destroy()ing program that's currently running kill it. if(hard_drive.parent_computer?.active_program == src) hard_drive.parent_computer.kill_program(TRUE) diff --git a/code/modules/modular_computers/hardware/hard_drive.dm b/code/modules/modular_computers/hardware/hard_drive.dm index 999edff6604..eef9f9d78a2 100644 --- a/code/modules/modular_computers/hardware/hard_drive.dm +++ b/code/modules/modular_computers/hardware/hard_drive.dm @@ -100,12 +100,10 @@ /** * Use this proc to remove files to the drive. Returns 1 on success and 0 on failure. Contains necessary sanity checks. */ -/obj/item/computer_hardware/hard_drive/proc/remove_file(var/datum/computer_file/F) - if(!F || !istype(F)) +/obj/item/computer_hardware/hard_drive/proc/remove_file(var/datum/computer_file/F, force = FALSE) + if(!F || !istype(F) || !stored_files) return FALSE - if(!stored_files || read_only) - return FALSE - if(!check_functionality()) + if(!force && (read_only || !check_functionality())) return FALSE if(F in stored_files) stored_files -= F diff --git a/code/modules/modular_computers/hardware/portable_hard_drive.dm b/code/modules/modular_computers/hardware/portable_hard_drive.dm index fcd2912d9fa..409060ed078 100644 --- a/code/modules/modular_computers/hardware/portable_hard_drive.dm +++ b/code/modules/modular_computers/hardware/portable_hard_drive.dm @@ -26,7 +26,9 @@ max_capacity = 256 origin_tech = list(TECH_DATA = 4) -/obj/item/computer_hardware/hard_drive/portable/New() - ..() +/obj/item/computer_hardware/hard_drive/portable/Initialize(mapload) + . = ..() + for(var/datum/computer_file/F in stored_files) + remove_file(F, TRUE) stored_files = list() recalculate_size() diff --git a/code/modules/modular_computers/hardware/portable_hard_drive_presets.dm b/code/modules/modular_computers/hardware/portable_hard_drive_presets.dm index ada04cc625f..38f7d1c91ed 100644 --- a/code/modules/modular_computers/hardware/portable_hard_drive_presets.dm +++ b/code/modules/modular_computers/hardware/portable_hard_drive_presets.dm @@ -2,10 +2,6 @@ . = ..() add_programs() -/obj/item/computer_hardware/hard_drive/portable/super/preset/all/Destroy() - . = ..() - GC_TEMPORARY_HARDDEL - /obj/item/computer_hardware/hard_drive/portable/super/preset/all/proc/add_programs() for(var/F in typesof(/datum/computer_file/program)) var/datum/computer_file/program/prog = new F("Compless") diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index c1684f1276f..d5c8e315787 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -21,11 +21,12 @@ GLOBAL_LIST_EMPTY(escape_pods_by_name) if(own_target) var/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/own_target_master = own_target.master if(own_target_master) - own_target_master.pod = src + own_target_master.set_pod(src) /datum/shuttle/autodock/ferry/escape_pod/Destroy() GLOB.escape_pods -= src GLOB.escape_pods_by_name -= name + arming_controller = null . = ..() /datum/shuttle/autodock/ferry/escape_pod/can_launch() @@ -50,6 +51,21 @@ GLOBAL_LIST_EMPTY(escape_pods_by_name) name = "escape pod controller" var/datum/shuttle/autodock/ferry/escape_pod/pod +/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/Destroy() + pod = null + . = ..() + +/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/proc/set_pod(datum/shuttle/autodock/ferry/escape_pod/new_pod) + if(istype(new_pod)) + pod = new_pod + RegisterSignal(pod, COMSIG_QDELETING, PROC_REF(clear_pod)) + +/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/proc/clear_pod() + SIGNAL_HANDLER + if(pod) + UnregisterSignal(pod, COMSIG_QDELETING) + pod = null + /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) diff --git a/html/changelogs/johnwildkins-awnaw.yml b/html/changelogs/johnwildkins-awnaw.yml new file mode 100644 index 00000000000..8348d39c260 --- /dev/null +++ b/html/changelogs/johnwildkins-awnaw.yml @@ -0,0 +1,12 @@ +author: JohnWildkins + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fix many instances of objects hard deleting, causing lag spikes."