From 1642176ad31bdaa2ea93806eee3b12b1a32c02ec Mon Sep 17 00:00:00 2001 From: Lucy Date: Sat, 29 Jun 2024 02:32:20 -0400 Subject: [PATCH] Fix various components holding onto callbacks (#2451) * Possible fix for qdeleted callbacks with chickens * Fix hanging action with rounys --- monkestation/code/datums/components/multi_hit.dm | 6 +++++- .../code/modules/blueshift/benos/beno_types/rouny.dm | 4 ++++ .../code/modules/blueshift/components/cell_component.dm | 3 +-- .../code/modules/blueshift/components/wall_mounted.dm | 4 ++++ monkestation/code/modules/liquids/liquid_interaction.dm | 4 ++++ monkestation/code/modules/physics/physics_component.dm | 2 +- monkestation/code/modules/ranching/components/aging.dm | 4 ++++ .../code/modules/ranching/components/happiness_container.dm | 3 ++- monkestation/code/modules/ranching/components/hatching.dm | 4 ++++ monkestation/code/modules/ranching/components/shearable.dm | 5 +++++ .../code/modules/slimecore/components/latch_feeding.dm | 2 +- 11 files changed, 35 insertions(+), 6 deletions(-) diff --git a/monkestation/code/datums/components/multi_hit.dm b/monkestation/code/datums/components/multi_hit.dm index 870b7be7b79a..7c439ebf6631 100644 --- a/monkestation/code/datums/components/multi_hit.dm +++ b/monkestation/code/datums/components/multi_hit.dm @@ -45,6 +45,11 @@ src.stamina_cost = stamina_cost item_parent = parent +/datum/component/multi_hit/Destroy(force, silent) + after_hit_callback = null + pre_hit_callback = null + return ..() + /datum/component/multi_hit/RegisterWithParent() RegisterSignal(parent, COMSIG_ITEM_PRE_ATTACK, PROC_REF(pre_hit_callback)) @@ -52,7 +57,6 @@ . = ..() UnregisterSignal(parent, COMSIG_ITEM_PRE_ATTACK) - /datum/component/multi_hit/proc/pre_hit_callback(datum/source, obj/item/thing, mob/user, params) SIGNAL_HANDLER diff --git a/monkestation/code/modules/blueshift/benos/beno_types/rouny.dm b/monkestation/code/modules/blueshift/benos/beno_types/rouny.dm index 0d1e4af8ec5e..bd39d44da8f5 100644 --- a/monkestation/code/modules/blueshift/benos/beno_types/rouny.dm +++ b/monkestation/code/modules/blueshift/benos/beno_types/rouny.dm @@ -25,6 +25,10 @@ add_movespeed_modifier(/datum/movespeed_modifier/alien_quick) +/mob/living/carbon/alien/adult/nova/runner/Destroy() + QDEL_NULL(evade_ability) + return ..() + /mob/living/carbon/alien/adult/nova/runner/create_internal_organs() organs += new /obj/item/organ/internal/alien/plasmavessel/small/tiny ..() diff --git a/monkestation/code/modules/blueshift/components/cell_component.dm b/monkestation/code/modules/blueshift/components/cell_component.dm index 9a4522c17d94..eec1cd115e96 100644 --- a/monkestation/code/modules/blueshift/components/cell_component.dm +++ b/monkestation/code/modules/blueshift/components/cell_component.dm @@ -87,8 +87,7 @@ component_cell_out_of_charge/component_cell_removed proc using loc where necessa UnregisterSignal(parent, COMSIG_ATOM_EXAMINE) /datum/component/cell/Destroy(force, silent) - if(on_cell_removed) - on_cell_removed = null + on_cell_removed = null if(inserted_cell) if(!inside_robot) //We really don't want to be deleting the robot's cell. QDEL_NULL(inserted_cell) diff --git a/monkestation/code/modules/blueshift/components/wall_mounted.dm b/monkestation/code/modules/blueshift/components/wall_mounted.dm index 1ed4632c5a65..49032e71db95 100644 --- a/monkestation/code/modules/blueshift/components/wall_mounted.dm +++ b/monkestation/code/modules/blueshift/components/wall_mounted.dm @@ -15,6 +15,10 @@ hanging_wall_turf = target_wall on_drop = on_drop_callback +/datum/component/wall_mounted/Destroy(force, silent) + on_drop = null + return ..() + /datum/component/wall_mounted/RegisterWithParent() ADD_TRAIT(parent, TRAIT_WALLMOUNTED, REF(src)) RegisterSignal(hanging_wall_turf, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine)) diff --git a/monkestation/code/modules/liquids/liquid_interaction.dm b/monkestation/code/modules/liquids/liquid_interaction.dm index 0a43b0c9f512..e9b725047a85 100644 --- a/monkestation/code/modules/liquids/liquid_interaction.dm +++ b/monkestation/code/modules/liquids/liquid_interaction.dm @@ -11,6 +11,10 @@ interaction_callback = CALLBACK(parent, on_interaction_callback) +/datum/component/liquids_interaction/Destroy(force, silent) + interaction_callback = null + return ..() + /datum/component/liquids_interaction/RegisterWithParent() RegisterSignal(parent, COMSIG_ITEM_AFTERATTACK, PROC_REF(AfterAttack)) //The only signal allowing item -> turf interaction diff --git a/monkestation/code/modules/physics/physics_component.dm b/monkestation/code/modules/physics/physics_component.dm index fbd705b92170..fd7b02da5754 100644 --- a/monkestation/code/modules/physics/physics_component.dm +++ b/monkestation/code/modules/physics/physics_component.dm @@ -122,10 +122,10 @@ set_angle(angle) /datum/component/movable_physics/Destroy(force, silent) - . = ..() bounce_callback = null stop_callback = null cached_transform = null + return ..() /datum/component/movable_physics/RegisterWithParent() RegisterSignal(parent, COMSIG_MOVABLE_BUMP, PROC_REF(on_bump)) diff --git a/monkestation/code/modules/ranching/components/aging.dm b/monkestation/code/modules/ranching/components/aging.dm index 505ea914ed0f..1726af06c261 100644 --- a/monkestation/code/modules/ranching/components/aging.dm +++ b/monkestation/code/modules/ranching/components/aging.dm @@ -19,6 +19,10 @@ START_PROCESSING(SSobj, src) +/datum/component/aging/Destroy(force, silent) + death_callback = null + return ..() + /datum/component/aging/RegisterWithParent() . = ..() RegisterSignal(parent, COMSIG_AGE_ADJUSTMENT, PROC_REF(adjust_age)) diff --git a/monkestation/code/modules/ranching/components/happiness_container.dm b/monkestation/code/modules/ranching/components/happiness_container.dm index 350223d910e0..03c307aac72f 100644 --- a/monkestation/code/modules/ranching/components/happiness_container.dm +++ b/monkestation/code/modules/ranching/components/happiness_container.dm @@ -30,8 +30,9 @@ src.unhappy_callbacks = unhappy_callbacks /datum/component/happiness_container/Destroy(force, silent) - . = ..() + unhappy_callbacks = null QDEL_NULL(applied_visual) + return ..() /datum/component/happiness_container/RegisterWithParent() . = ..() diff --git a/monkestation/code/modules/ranching/components/hatching.dm b/monkestation/code/modules/ranching/components/hatching.dm index 56f358c656b9..7884eb41ab47 100644 --- a/monkestation/code/modules/ranching/components/hatching.dm +++ b/monkestation/code/modules/ranching/components/hatching.dm @@ -45,6 +45,10 @@ START_PROCESSING(SSobj, src) +/datum/component/hatching/Destroy(force, silent) + hatch_callback = null + return ..() + /datum/component/hatching/process(seconds_per_tick) if(!COOLDOWN_FINISHED(src, failed_cooldown)) return diff --git a/monkestation/code/modules/ranching/components/shearable.dm b/monkestation/code/modules/ranching/components/shearable.dm index e576509f1b07..2cd0676ae3e7 100644 --- a/monkestation/code/modules/ranching/components/shearable.dm +++ b/monkestation/code/modules/ranching/components/shearable.dm @@ -34,6 +34,11 @@ created_amount = amount src.created = created +/datum/component/shearable/Destroy(force, silent) + regrow = null + post_shear = null + return ..() + /datum/component/shearable/RegisterWithParent() . = ..() RegisterSignal(parent, COMSIG_MOB_SHEARED, PROC_REF(try_shear)) diff --git a/monkestation/code/modules/slimecore/components/latch_feeding.dm b/monkestation/code/modules/slimecore/components/latch_feeding.dm index 05d393ddc171..c08040a2f59c 100644 --- a/monkestation/code/modules/slimecore/components/latch_feeding.dm +++ b/monkestation/code/modules/slimecore/components/latch_feeding.dm @@ -34,9 +34,9 @@ /datum/component/latch_feeding/Destroy(force, silent) REMOVE_TRAIT(parent, TRAIT_FEEDING, LATCH_TRAIT) - . = ..() target = null check_and_replace = null + return ..() /datum/component/latch_feeding/RegisterWithParent() RegisterSignal(parent, COMSIG_LIVING_SET_BUCKLED, PROC_REF(check_buckled))