From 513facdb0dbda8cc0a481e73f2e98d2dfa5dc736 Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Mon, 4 Nov 2024 22:51:18 +0100 Subject: [PATCH] Refactored deletion observables to use the COMSIG_QDELETING signal (#20121) Refactored deletion observables to use the COMSIG_QDELETING signal instead, removed the observable. --- aurorastation.dme | 1 - code/datums/datum.dm | 1 - code/datums/observation/destroyed.dm | 4 -- code/datums/sound_player.dm | 8 +-- .../endgame/bluespace_jump/bluespace_jump.dm | 4 +- code/game/machinery/body_scanner.dm | 11 +++- code/game/machinery/ringer.dm | 5 +- code/game/objects/items/devices/hacktool.dm | 6 +- code/game/objects/items/devices/multitool.dm | 10 +++- .../items/weapons/cards_ids_syndicate.dm | 8 ++- .../objects/items/weapons/teleportation.dm | 4 +- code/modules/admin/buildmode/edit.dm | 4 +- code/modules/admin/buildmode/move_into.dm | 4 +- .../heavy_vehicle/equipment/_equipment.dm | 4 +- .../heavy_vehicle/equipment/utility.dm | 4 +- .../heavy_vehicle/mech_construction.dm | 6 +- .../subtypes/manipulation.dm | 4 +- .../mob/abstract/freelook/visualnet.dm | 4 +- .../overmap/contacts/contact_sensors.dm | 6 +- code/modules/overmap/exoplanets/exoplanet.dm | 6 +- code/modules/overmap/ships/landable.dm | 4 +- code/modules/paperwork/journal.dm | 2 +- .../targeting/targeting_overlay.dm | 4 +- .../synthesized_instruments/sound_token.dm | 4 +- .../fluffyghost-removedeletionobservable.yml | 58 +++++++++++++++++++ 25 files changed, 120 insertions(+), 56 deletions(-) delete mode 100644 code/datums/observation/destroyed.dm create mode 100644 html/changelogs/fluffyghost-removedeletionobservable.yml diff --git a/aurorastation.dme b/aurorastation.dme index cc47eb1374e..e5e04ad3506 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -481,7 +481,6 @@ #include "code\datums\looping_sounds\thermal_drill.dm" #include "code\datums\observation\_debug.dm" #include "code\datums\observation\death.dm" -#include "code\datums\observation\destroyed.dm" #include "code\datums\observation\dir_set.dm" #include "code\datums\observation\entered.dm" #include "code\datums\observation\exited.dm" diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 79b3621ca32..5e7a4b38d51 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -104,7 +104,6 @@ #endif #endif - GLOB.destroyed_event.raise_event(src) if (!isturf(src)) cleanup_events(src) diff --git a/code/datums/observation/destroyed.dm b/code/datums/observation/destroyed.dm deleted file mode 100644 index efd973951c2..00000000000 --- a/code/datums/observation/destroyed.dm +++ /dev/null @@ -1,4 +0,0 @@ -GLOBAL_DATUM_INIT(destroyed_event, /singleton/observ/destroyed, new) - -/singleton/observ/destroyed - name = "Destroyed" diff --git a/code/datums/sound_player.dm b/code/datums/sound_player.dm index f3b6240e5e5..b950a1a1463 100644 --- a/code/datums/sound_player.dm +++ b/code/datums/sound_player.dm @@ -114,7 +114,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new) listeners = list() listener_status = list() - GLOB.destroyed_event.register(source, src, /datum/proc/qdel_self) + RegisterSignal(source, COMSIG_QDELETING, TYPE_PROC_REF(/datum, qdel_self)) PrivLocateListeners() START_PROCESSING(SSprocessing, src) @@ -154,7 +154,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new) listeners = null listener_status = null - GLOB.destroyed_event.unregister(source, src, /datum/proc/qdel_self) + UnregisterSignal(source, COMSIG_QDELETING) source = null GLOB.sound_player.PrivStopSound(src) @@ -198,7 +198,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new) listeners += listener RegisterSignal(listener, COMSIG_MOVABLE_MOVED, PROC_REF(PrivUpdateListenerLoc)) - GLOB.destroyed_event.register(listener, src, PROC_REF(PrivRemoveListener)) + RegisterSignal(listener, COMSIG_QDELETING, PROC_REF(PrivRemoveListener)) PrivUpdateListenerLoc(listener, update_sound = FALSE) @@ -206,7 +206,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new) null_sound = null_sound || new(channel = sound.channel) sound_to(listener, null_sound) UnregisterSignal(listener, COMSIG_MOVABLE_MOVED) - GLOB.destroyed_event.unregister(listener, src, PROC_REF(PrivRemoveListener)) + UnregisterSignal(listener, COMSIG_QDELETING) listeners -= listener /datum/sound_token/proc/PrivUpdateListenerLoc(atom/movable/listener, atom/old_loc, dir, forced, list/old_locs, update_sound = TRUE) diff --git a/code/game/gamemodes/endgame/bluespace_jump/bluespace_jump.dm b/code/game/gamemodes/endgame/bluespace_jump/bluespace_jump.dm index 40066a5b14e..3b339919146 100644 --- a/code/game/gamemodes/endgame/bluespace_jump/bluespace_jump.dm +++ b/code/game/gamemodes/endgame/bluespace_jump/bluespace_jump.dm @@ -74,11 +74,11 @@ appearance = daddy.appearance RegisterSignal(daddy, COMSIG_MOVABLE_MOVED, PROC_REF(mirror)) GLOB.dir_set_event.register(daddy, src, PROC_REF(mirror_dir)) - GLOB.destroyed_event.register(daddy, src, TYPE_PROC_REF(/datum, qdel_self)) + RegisterSignal(daddy, COMSIG_QDELETING, TYPE_PROC_REF(/datum, qdel_self)) /obj/effect/bluegoast/Destroy() if(daddy) - GLOB.destroyed_event.unregister(daddy, src) + UnregisterSignal(daddy, COMSIG_QDELETING) GLOB.dir_set_event.unregister(daddy, src) UnregisterSignal(daddy, COMSIG_MOVABLE_MOVED) daddy = null diff --git a/code/game/machinery/body_scanner.dm b/code/game/machinery/body_scanner.dm index 060601a0b08..27987b30a27 100644 --- a/code/game/machinery/body_scanner.dm +++ b/code/game/machinery/body_scanner.dm @@ -333,7 +333,7 @@ for(var/obj/machinery/computer/operating/D in SSmachinery.machinery) if (AreConnectedZLevels(D.z, z)) connected_displays += D - GLOB.destroyed_event.register(D, src, PROC_REF(remove_display)) + RegisterSignal(D, COMSIG_QDELETING, PROC_REF(on_connected_display_deletion)) return !!length(connected_displays) /obj/machinery/body_scanconsole/ui_interact(mob/user, var/datum/tgui/ui) @@ -345,9 +345,14 @@ ui = new(user, src, "BodyScanner", tgui_name, 850, 500) ui.open() -/obj/machinery/body_scanconsole/proc/remove_display(obj/machinery/computer/operating/display) +/obj/machinery/body_scanconsole/proc/on_connected_display_deletion(datum/source) + SIGNAL_HANDLER + + remove_display(source) + +/obj/machinery/body_scanconsole/proc/remove_display(datum/source, obj/machinery/computer/operating/display) connected_displays -= display - GLOB.destroyed_event.unregister(display, src, PROC_REF(remove_display)) + UnregisterSignal(display, COMSIG_QDELETING) /obj/machinery/body_scanconsole/proc/get_connected() if(connected) diff --git a/code/game/machinery/ringer.dm b/code/game/machinery/ringer.dm index ef4a7262e69..4f3a65ec5b7 100644 --- a/code/game/machinery/ringer.dm +++ b/code/game/machinery/ringer.dm @@ -127,8 +127,7 @@ pixel_x = 8; return TRUE to_chat(user, SPAN_NOTICE("You link \the [attacking_item] to \the [src], it will now ring upon someone using \the [src].")) rings_pdas += attacking_item - // WONT FIX: This requires callbacks fuck my dick. - GLOB.destroyed_event.register(attacking_item, src, PROC_REF(remove_pda)) + UnregisterSignal(attacking_item, COMSIG_QDELETING) update_icon() return TRUE else @@ -173,7 +172,7 @@ pixel_x = 8; pinged = FALSE update_icon() -/obj/machinery/ringer/proc/remove_pda(var/obj/item/modular_computer/P) +/obj/machinery/ringer/proc/remove_pda(obj/item/modular_computer/P) if (istype(P)) rings_pdas -= P diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm index daf4fc19edf..ae5b65b8511 100644 --- a/code/game/objects/items/devices/hacktool.dm +++ b/code/game/objects/items/devices/hacktool.dm @@ -23,7 +23,7 @@ /obj/item/device/multitool/hacktool/Destroy() for(var/T in known_targets) var/atom/target = T - GLOB.destroyed_event.unregister(target, src) + UnregisterSignal(target, COMSIG_QDELETING) known_targets.Cut() qdel(hack_state) hack_state = null @@ -88,7 +88,7 @@ return FALSE known_targets.Insert(1, target) // Insert the newly hacked target first, - GLOB.destroyed_event.register(target, src, PROC_REF(on_target_destroy)) + RegisterSignal(target, COMSIG_QDELETING, PROC_REF(on_target_destroy)) return TRUE /obj/item/device/multitool/hacktool/proc/sanity_check() @@ -98,7 +98,7 @@ if(known_targets.len > max_known_targets) for(var/i = (max_known_targets + 1) to known_targets.len) var/atom/A = known_targets[i] - GLOB.destroyed_event.unregister(A, src) + UnregisterSignal(A, COMSIG_QDELETING) known_targets.Cut(max_known_targets + 1) /obj/item/device/multitool/hacktool/proc/on_target_destroy(var/target) diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index 421cc6631ae..67d96706696 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -65,14 +65,18 @@ unregister_buffer(buffer_object) buffer_object = buffer if(buffer_object) - GLOB.destroyed_event.register(buffer_object, src, PROC_REF(unregister_buffer)) + RegisterSignal(buffer_object, COMSIG_QDELETING, PROC_REF(on_buffer_object_deletion)) update_icon() -/obj/item/device/multitool/proc/unregister_buffer(var/atom/buffer_to_unregister) +/obj/item/device/multitool/proc/on_buffer_object_deletion(datum/source) + SIGNAL_HANDLER + unregister_buffer(source) + +/obj/item/device/multitool/proc/unregister_buffer(atom/buffer_to_unregister) // Only remove the buffered object, don't reset the name // This means one cannot know if the buffer has been destroyed until one attempts to use it. if(buffer_to_unregister == buffer_object && buffer_object) - GLOB.destroyed_event.unregister(buffer_object, src) + UnregisterSignal(buffer_object, COMSIG_QDELETING) buffer_object = null update_icon() diff --git a/code/game/objects/items/weapons/cards_ids_syndicate.dm b/code/game/objects/items/weapons/cards_ids_syndicate.dm index bf1c572865a..e3fdab01b4a 100644 --- a/code/game/objects/items/weapons/cards_ids_syndicate.dm +++ b/code/game/objects/items/weapons/cards_ids_syndicate.dm @@ -83,13 +83,17 @@ unset_registered_user() registered_user = user user.set_id_info(src) - GLOB.destroyed_event.register(user, src, PROC_REF(unset_registered_user)) + RegisterSignal(user, COMSIG_QDELETING, PROC_REF(on_user_deletion)) return TRUE +/obj/item/card/id/syndicate/proc/on_user_deletion(datum/source) + SIGNAL_HANDLER + unset_registered_user(source) + /obj/item/card/id/syndicate/proc/unset_registered_user(var/mob/user) if(!registered_user || (user && user != registered_user)) return - GLOB.destroyed_event.unregister(registered_user, src) + UnregisterSignal(registered_user, COMSIG_QDELETING) registered_user = null /obj/item/card/id/syndicate/CanUseTopic(mob/user) diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index 57e9c347556..edc0483db4e 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -245,9 +245,9 @@ Frequency: var/old_pad = linked_pad linked_pad = teleport_options[teleport_choice] if(linked_pad) - GLOB.destroyed_event.register(linked_pad, src, PROC_REF(pad_destroyed)) + RegisterSignal(linked_pad, COMSIG_QDELETING, PROC_REF(pad_destroyed)) if(old_pad && linked_pad != old_pad) - GLOB.destroyed_event.unregister(old_pad, src) + UnregisterSignal(old_pad, COMSIG_QDELETING) return return ..() diff --git a/code/modules/admin/buildmode/edit.dm b/code/modules/admin/buildmode/edit.dm index edaf59bd2ab..cb69c623f1e 100644 --- a/code/modules/admin/buildmode/edit.dm +++ b/code/modules/admin/buildmode/edit.dm @@ -69,13 +69,13 @@ return ClearValue() value_to_set = new_value - GLOB.destroyed_event.register(value_to_set, src, /datum/build_mode/edit/proc/ClearValue) + RegisterSignal(value_to_set, COMSIG_QDELETING, /datum/build_mode/edit/proc/ClearValue) /datum/build_mode/edit/proc/ClearValue(var/feedback) if(!istype(value_to_set, /datum)) return - GLOB.destroyed_event.unregister(value_to_set, src, /datum/build_mode/edit/proc/ClearValue) + UnregisterSignal(value_to_set, COMSIG_QDELETING) value_to_set = initial(value_to_set) if(feedback) Warn("The selected reference value was deleted. Default value restored.") diff --git a/code/modules/admin/buildmode/move_into.dm b/code/modules/admin/buildmode/move_into.dm index 8ad6e00a8c6..6bb231d0862 100644 --- a/code/modules/admin/buildmode/move_into.dm +++ b/code/modules/admin/buildmode/move_into.dm @@ -33,14 +33,14 @@ ClearDestination() destination = A - GLOB.destroyed_event.register(destination, src, /datum/build_mode/move_into/proc/ClearDestination) + RegisterSignal(destination, COMSIG_QDELETING, /datum/build_mode/move_into/proc/ClearDestination) to_chat(user, SPAN_NOTICE("Will now move targets into \the [destination].")) /datum/build_mode/move_into/proc/ClearDestination(var/feedback) if(!destination) return - GLOB.destroyed_event.unregister(destination, src, /datum/build_mode/move_into/proc/ClearDestination) + UnregisterSignal(destination, COMSIG_QDELETING) destination = null if(feedback) Warn("The selected destination was deleted.") diff --git a/code/modules/heavy_vehicle/equipment/_equipment.dm b/code/modules/heavy_vehicle/equipment/_equipment.dm index 3cb74af92e0..bd74ad98b3a 100644 --- a/code/modules/heavy_vehicle/equipment/_equipment.dm +++ b/code/modules/heavy_vehicle/equipment/_equipment.dm @@ -92,14 +92,14 @@ /obj/item/mecha_equipment/mounted_system/proc/forget_holding() if(holding) //It'd be strange for this to be called with this var unset - GLOB.destroyed_event.unregister(holding, src, PROC_REF(forget_holding)) + UnregisterSignal(holding, COMSIG_QDELETING) holding = null /obj/item/mecha_equipment/mounted_system/Initialize() . = ..() if(holding_type) holding = new holding_type(src) - GLOB.destroyed_event.register(holding, src, PROC_REF(forget_holding)) + RegisterSignal(holding, COMSIG_QDELETING, PROC_REF(forget_holding)) if(holding) if(!icon_state) icon = holding.icon diff --git a/code/modules/heavy_vehicle/equipment/utility.dm b/code/modules/heavy_vehicle/equipment/utility.dm index 0af3601d7d8..0b35a3a96f2 100644 --- a/code/modules/heavy_vehicle/equipment/utility.dm +++ b/code/modules/heavy_vehicle/equipment/utility.dm @@ -265,7 +265,7 @@ /obj/item/mecha_equipment/catapult/proc/beamdestroyed() if(beam) - GLOB.destroyed_event.unregister(beam, src, .proc/beamdestroyed) + UnregisterSignal(beam, COMSIG_QDELETING) beam = null if(locked) if(owner) @@ -316,7 +316,7 @@ return locked = AM beam = owner.Beam(BeamTarget = target, icon_state = "r_beam", maxdistance = max_dist, beam_type = /obj/effect/ebeam/warp) - GLOB.destroyed_event.register(beam, src, .proc/beamdestroyed) + RegisterSignal(beam, COMSIG_QDELETING, PROC_REF(beamdestroyed)) animate(target,pixel_y= initial(target.pixel_y) - 2,time=1 SECOND, easing = SINE_EASING, flags = ANIMATION_PARALLEL, loop = -1) animate(pixel_y= initial(target.pixel_y) + 2,time=1 SECOND) diff --git a/code/modules/heavy_vehicle/mech_construction.dm b/code/modules/heavy_vehicle/mech_construction.dm index 44a3172ebf0..8dea5eff06c 100644 --- a/code/modules/heavy_vehicle/mech_construction.dm +++ b/code/modules/heavy_vehicle/mech_construction.dm @@ -100,7 +100,7 @@ if(target == selected_hardpoint) clear_selected_hardpoint() - GLOB.destroyed_event.unregister(module_to_forget, src, PROC_REF(forget_module)) + UnregisterSignal(module_to_forget, COMSIG_QDELETING) var/atom/movable/screen/mecha/hardpoint/H = hardpoint_hud_elements[target] H.holding = null @@ -144,7 +144,7 @@ if(!found) return FALSE ME.installed(src) - GLOB.destroyed_event.register(system, src, PROC_REF(forget_module)) + RegisterSignal(system, COMSIG_QDELETING, PROC_REF(forget_module)) system.forceMove(src) @@ -198,7 +198,7 @@ system.forceMove(get_turf(src)) system.screen_loc = null system.layer = initial(system.layer) - GLOB.destroyed_event.unregister(system, src, PROC_REF(forget_module)) + UnregisterSignal(system, COMSIG_QDELETING) var/atom/movable/screen/mecha/hardpoint/H = hardpoint_hud_elements[system_hardpoint] H.holding = null diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm index 2187fb83bbb..11f338c2420 100644 --- a/code/modules/integrated_electronics/subtypes/manipulation.dm +++ b/code/modules/integrated_electronics/subtypes/manipulation.dm @@ -170,14 +170,14 @@ // These procs do not relocate the grenade, that's the callers responsibility /obj/item/integrated_circuit/manipulation/grenade/proc/attach_grenade(var/obj/item/grenade/G) attached_grenade = G - GLOB.destroyed_event.register(attached_grenade, src, PROC_REF(detach_grenade)) + RegisterSignal(attached_grenade, COMSIG_QDELETING, PROC_REF(detach_grenade)) size += G.w_class desc += " \An [attached_grenade] is attached to it!" /obj/item/integrated_circuit/manipulation/grenade/proc/detach_grenade() if(!attached_grenade) return - GLOB.destroyed_event.unregister(attached_grenade, src) + UnregisterSignal(attached_grenade, COMSIG_QDELETING) attached_grenade = null size = initial(size) desc = initial(desc) diff --git a/code/modules/mob/abstract/freelook/visualnet.dm b/code/modules/mob/abstract/freelook/visualnet.dm index e6dcbec2bfb..d76d66a5696 100644 --- a/code/modules/mob/abstract/freelook/visualnet.dm +++ b/code/modules/mob/abstract/freelook/visualnet.dm @@ -119,7 +119,7 @@ return FALSE sources += source RegisterSignal(source, COMSIG_MOVABLE_MOVED, PROC_REF(source_moved)) - GLOB.destroyed_event.register(source, src, PROC_REF(remove_source)) + RegisterSignal(source, COMSIG_QDELETING, PROC_REF(remove_source)) for_all_chunks_in_range(source, TYPE_PROC_REF(/datum/chunk, add_source), list(source)) if(update_visibility) update_visibility(source, opacity_check) @@ -129,7 +129,7 @@ if(!sources.Remove(source)) return FALSE UnregisterSignal(source, COMSIG_MOVABLE_MOVED) - GLOB.destroyed_event.unregister(source, src) + UnregisterSignal(source, COMSIG_QDELETING) for_all_chunks_in_range(source, /datum/chunk/proc/remove_source, list(source)) if(update_visibility) update_visibility(source, opacity_check) diff --git a/code/modules/overmap/contacts/contact_sensors.dm b/code/modules/overmap/contacts/contact_sensors.dm index e25ecd1ed77..61ffde9d61f 100644 --- a/code/modules/overmap/contacts/contact_sensors.dm +++ b/code/modules/overmap/contacts/contact_sensors.dm @@ -163,14 +163,14 @@ if(tracker in trackers) trackers -= tracker - GLOB.destroyed_event.unregister(tracker, src, PROC_REF(remove_tracker)) + UnregisterSignal(tracker, COMSIG_QDELETING) to_chat(user, SPAN_NOTICE("You unlink the tracker in \the [P]'s buffer from \the [src].")) return trackers += tracker - GLOB.destroyed_event.register(tracker, src, PROC_REF(remove_tracker)) + RegisterSignal(tracker, COMSIG_QDELETING, PROC_REF(remove_tracker)) to_chat(user, SPAN_NOTICE("You link the tracker in \the [P]'s buffer to \the [src].")) -/obj/machinery/computer/ship/sensors/proc/remove_tracker(var/obj/item/ship_tracker/tracker) +/obj/machinery/computer/ship/sensors/proc/remove_tracker(obj/item/ship_tracker/tracker) trackers -= tracker /obj/machinery/computer/ship/sensors/proc/datalink_process() diff --git a/code/modules/overmap/exoplanets/exoplanet.dm b/code/modules/overmap/exoplanets/exoplanet.dm index 9cb1eb76d9e..d4053991d6a 100644 --- a/code/modules/overmap/exoplanets/exoplanet.dm +++ b/code/modules/overmap/exoplanets/exoplanet.dm @@ -260,7 +260,7 @@ var/mob/S = new mob_type(T) animals += S GLOB.death_event.register(S, src, PROC_REF(remove_animal)) - GLOB.destroyed_event.register(S, src, PROC_REF(remove_animal)) + RegisterSignal(S, COMSIG_QDELETING, PROC_REF(remove_animal)) adapt_animal(S) if(animals.len >= max_animal_count) repopulating = 0 @@ -279,10 +279,10 @@ daddy.group_multiplier = Z.air.group_multiplier Z.air.equalize(daddy) -/obj/effect/overmap/visitable/sector/exoplanet/proc/remove_animal(var/mob/M) +/obj/effect/overmap/visitable/sector/exoplanet/proc/remove_animal(mob/M) animals -= M GLOB.death_event.unregister(M, src) - GLOB.destroyed_event.unregister(M, src) + UnregisterSignal(M, COMSIG_QDELETING) repopulate_types |= M.type /obj/effect/overmap/visitable/sector/exoplanet/proc/generate_map() diff --git a/code/modules/overmap/ships/landable.dm b/code/modules/overmap/ships/landable.dm index 639c5b13c68..24fb86880e8 100644 --- a/code/modules/overmap/ships/landable.dm +++ b/code/modules/overmap/ships/landable.dm @@ -133,11 +133,11 @@ core_landmark = master name = _name landmark_tag = master.shuttle_name + _name - GLOB.destroyed_event.register(master, src, GLOBAL_PROC_REF(qdel)) + RegisterSignal(master, COMSIG_QDELETING, TYPE_PROC_REF(/datum, qdel_self)) . = ..() /obj/effect/shuttle_landmark/visiting_shuttle/Destroy() - GLOB.destroyed_event.unregister(core_landmark, src) + UnregisterSignal(core_landmark, COMSIG_QDELETING) LAZYREMOVE(core_landmark.visitors, src) core_landmark = null . = ..() diff --git a/code/modules/paperwork/journal.dm b/code/modules/paperwork/journal.dm index 87fd6441e72..d55d38d79b7 100644 --- a/code/modules/paperwork/journal.dm +++ b/code/modules/paperwork/journal.dm @@ -99,7 +99,7 @@ index_name = "Index ([length(indices) + 1])" E.name = index_name LAZYSET(indices, E.name, E) - GLOB.destroyed_event.register(E, src, PROC_REF(remove_index)) + RegisterSignal(E, COMSIG_QDELETING, PROC_REF(remove_index)) return E /obj/item/journal/proc/remove_index(var/obj/item/folder/embedded/E) diff --git a/code/modules/projectiles/targeting/targeting_overlay.dm b/code/modules/projectiles/targeting/targeting_overlay.dm index 846b16a4ac8..101889c4e13 100644 --- a/code/modules/projectiles/targeting/targeting_overlay.dm +++ b/code/modules/projectiles/targeting/targeting_overlay.dm @@ -215,7 +215,7 @@ lock_time = world.time + 35 RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(update_aiming)) RegisterSignal(aiming_at, COMSIG_MOVABLE_MOVED, PROC_REF(target_moved)) - GLOB.destroyed_event.register(aiming_at, src, PROC_REF(cancel_aiming)) + RegisterSignal(aiming_at, COMSIG_QDELETING, PROC_REF(cancel_aiming)) /obj/aiming_overlay/proc/aim_cooldown(seconds) aimcooldown = world.time + seconds SECONDS @@ -261,7 +261,7 @@ UnregisterSignal(owner, COMSIG_MOVABLE_MOVED) if(aiming_at) UnregisterSignal(aiming_at, COMSIG_MOVABLE_MOVED) - GLOB.destroyed_event.unregister(aiming_at, src) + UnregisterSignal(aiming_at, COMSIG_QDELETING) LAZYREMOVE(aiming_at.aimed_at_by, src) aiming_at = null diff --git a/code/modules/synthesized_instruments/sound_token.dm b/code/modules/synthesized_instruments/sound_token.dm index ba6ee3014b4..a1347da4cf6 100644 --- a/code/modules/synthesized_instruments/sound_token.dm +++ b/code/modules/synthesized_instruments/sound_token.dm @@ -33,7 +33,7 @@ listeners = list() listener_status = list() - GLOB.destroyed_event.register(source, src, /datum/proc/qdel_self) + RegisterSignal(source, COMSIG_QDELETING, TYPE_PROC_REF(/datum, qdel_self)) player.subscribe(src) @@ -52,6 +52,6 @@ /datum/sound_token/instrument/Destroy() . = ..() - GLOB.destroyed_event.unregister(source, src, /datum/proc/qdel_self) + UnregisterSignal(source, COMSIG_QDELETING) player.unsubscribe(src) player = null diff --git a/html/changelogs/fluffyghost-removedeletionobservable.yml b/html/changelogs/fluffyghost-removedeletionobservable.yml new file mode 100644 index 00000000000..a4de99ff9eb --- /dev/null +++ b/html/changelogs/fluffyghost-removedeletionobservable.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost + +# 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: + - refactor: "Refactored deletion observables to use the COMSIG_QDELETING signal instead, removed the observable."