From 6fcbce39cde30d83f3589c8dc1386cf31fbbd0b4 Mon Sep 17 00:00:00 2001 From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:12:34 -0700 Subject: [PATCH] Makes turfs persist their signals, uses this to optimize connect_loc (#59608) * Makes turfs persist signals * Splits connect_loc up into two elements, one for stuff that wishes to connect on behalf of something, and one for stuff that just wants to connect normally. Connecting on behalf of someone has a significant amount of overhead, so let's do this to keep things clear * Converts all uses of connect_loc over to the new patterns * Adds some comments, actually makes turfs persist signals * There's no need to detach connect loc anymore, since all it does is unregister signals. Unregisters a signal from formorly decal'd turfs, and makes the changeturf signal persistance stuff actually work * bro fuck documentation * Changes from a var to a proc, prevents admemems and idiots * Extra detail on why we do the copy post qdel --- code/datums/ai/monkey/monkey_controller.dm | 4 +- code/datums/components/butchering.dm | 2 +- code/datums/components/food/edible.dm | 2 +- code/datums/components/infective.dm | 2 +- code/datums/components/pellet_cloud.dm | 2 +- code/datums/components/rot.dm | 4 +- code/datums/components/singularity.dm | 2 +- code/datums/components/slippery.dm | 10 +- code/datums/components/squeak.dm | 4 +- code/datums/components/swarming.dm | 3 +- code/datums/datum.dm | 11 ++- code/datums/elements/atmos_sensitive.dm | 2 +- code/datums/elements/caltrop.dm | 4 +- code/datums/elements/connect_loc.dm | 94 +++++++++++-------- code/datums/elements/decals/_decal.dm | 1 + code/datums/elements/squashable.dm | 4 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/machinery/doors/firedoor.dm | 2 +- code/game/machinery/doors/windowdoor.dm | 2 +- code/game/machinery/recycler.dm | 2 +- code/game/machinery/scan_gate.dm | 2 +- code/game/machinery/teambuilder.dm | 2 +- code/game/objects/effects/anomalies.dm | 4 +- code/game/objects/effects/decals/cleanable.dm | 2 +- .../effects/effect_system/effects_smoke.dm | 2 +- code/game/objects/effects/mines.dm | 2 +- code/game/objects/effects/portals.dm | 2 +- code/game/objects/effects/powerup.dm | 2 +- code/game/objects/effects/proximity.dm | 2 +- code/game/objects/effects/step_triggers.dm | 2 +- .../objects/items/devices/pressureplates.dm | 2 +- code/game/objects/items/handcuffs.dm | 2 +- .../game/objects/items/stacks/sheets/glass.dm | 2 +- code/game/objects/items/stacks/stack.dm | 2 +- code/game/objects/items/toys.dm | 2 +- .../objects/structures/industrial_lift.dm | 2 +- code/game/objects/structures/railings.dm | 2 +- code/game/objects/structures/shower.dm | 2 +- code/game/objects/structures/stairs.dm | 2 +- code/game/objects/structures/tables_racks.dm | 2 +- code/game/objects/structures/traps.dm | 2 +- .../objects/structures/windoor_assembly.dm | 2 +- code/game/objects/structures/window.dm | 2 +- code/game/turfs/change_turf.dm | 11 +++ code/game/turfs/turf.dm | 8 ++ .../abductor/equipment/abduction_gear.dm | 2 +- code/modules/assembly/infrared.dm | 2 +- code/modules/assembly/mousetrap.dm | 6 +- .../atmospherics/environmental/LINDA_fire.dm | 22 ++--- .../awaymissions/mission_code/wildwest.dm | 2 +- .../modules/awaymissions/super_secret_room.dm | 2 +- code/modules/clothing/glasses/_glasses.dm | 2 +- code/modules/events/spacevine.dm | 2 +- code/modules/flufftext/Hallucination.dm | 6 +- code/modules/hydroponics/grown/towercap.dm | 2 +- code/modules/hydroponics/hydroitemdefines.dm | 2 +- code/modules/mining/equipment/resonator.dm | 2 +- .../living/carbon/alien/special/facehugger.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 2 +- .../mob/living/simple_animal/bot/cleanbot.dm | 2 +- .../mob/living/simple_animal/bot/honkbot.dm | 2 +- .../living/simple_animal/bot/hygienebot.dm | 2 +- .../mob/living/simple_animal/bot/secbot.dm | 2 +- .../living/simple_animal/friendly/mouse.dm | 2 +- .../simple_animal/guardian/types/fire.dm | 2 +- .../simple_animal/guardian/types/ranged.dm | 2 +- .../simple_animal/hostile/jungle/leaper.dm | 2 +- .../hostile/megafauna/hierophant.dm | 2 +- .../hostile/mining_mobs/elites/legionnaire.dm | 2 +- .../simple_animal/hostile/retaliate/frog.dm | 2 +- .../simple_animal/hostile/venus_human_trap.dm | 2 +- code/modules/plumbing/plumbers/fermenter.dm | 2 +- .../plumbing/plumbers/grinder_chemical.dm | 2 +- code/modules/power/lighting.dm | 2 +- .../power/singularity/containment_field.dm | 2 +- code/modules/projectiles/projectile.dm | 2 +- .../ruins/objects_and_mobs/necropolis_gate.dm | 4 +- code/modules/shuttle/special.dm | 2 +- .../spell_types/spacetime_distortion.dm | 2 +- code/modules/swarmers/swarmer_objs.dm | 2 +- code/modules/unit_tests/connect_loc.dm | 2 +- 81 files changed, 182 insertions(+), 146 deletions(-) diff --git a/code/datums/ai/monkey/monkey_controller.dm b/code/datums/ai/monkey/monkey_controller.dm index e1be268621b..a4ad9a071a0 100644 --- a/code/datums/ai/monkey/monkey_controller.dm +++ b/code/datums/ai/monkey/monkey_controller.dm @@ -50,14 +50,14 @@ have ways of interacting with a specific mob and control it. var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, new_pawn, loc_connections) + AddElement(/datum/element/connect_loc_behalf, new_pawn, loc_connections) movement_delay = living_pawn.cached_multiplicative_slowdown return ..() //Run parent at end /datum/ai_controller/monkey/UnpossessPawn(destroy) UnregisterSignal(pawn, list(COMSIG_PARENT_ATTACKBY, COMSIG_ATOM_ATTACK_HAND, COMSIG_ATOM_ATTACK_PAW, COMSIG_ATOM_BULLET_ACT, COMSIG_ATOM_HITBY, COMSIG_LIVING_START_PULL,\ COMSIG_LIVING_TRY_SYRINGE, COMSIG_ATOM_HULK_ATTACK, COMSIG_CARBON_CUFF_ATTEMPTED, COMSIG_MOB_MOVESPEED_UPDATED)) - pawn.RemoveElement(/datum/element/connect_loc) + pawn.RemoveElement(/datum/element/connect_loc_behalf) return ..() //Run parent at end diff --git a/code/datums/components/butchering.dm b/code/datums/components/butchering.dm index ab045e1dd90..bed99a64906 100644 --- a/code/datums/components/butchering.dm +++ b/code/datums/components/butchering.dm @@ -146,7 +146,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, parent, loc_connections) + AddElement(/datum/element/connect_loc_behalf, parent, loc_connections) /datum/component/butchering/recycler/proc/on_entered(datum/source, atom/movable/arrived, direction) SIGNAL_HANDLER diff --git a/code/datums/components/food/edible.dm b/code/datums/components/food/edible.dm index 76b76f8192d..d7c40971380 100644 --- a/code/datums/components/food/edible.dm +++ b/code/datums/components/food/edible.dm @@ -72,7 +72,7 @@ Behavior that's still missing from this component that original food items had t var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, parent, loc_connections) + AddElement(/datum/element/connect_loc_behalf, parent, loc_connections) if(isitem(parent)) RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/UseFromHand) diff --git a/code/datums/components/infective.dm b/code/datums/components/infective.dm index 733a040bd75..be19bc421e5 100644 --- a/code/datums/components/infective.dm +++ b/code/datums/components/infective.dm @@ -18,7 +18,7 @@ var/static/list/disease_connections = list( COMSIG_ATOM_ENTERED = .proc/try_infect_crossed, ) - AddElement(/datum/element/connect_loc, parent, disease_connections) + AddElement(/datum/element/connect_loc_behalf, parent, disease_connections) RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean) RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, .proc/try_infect_buckle) diff --git a/code/datums/components/pellet_cloud.dm b/code/datums/components/pellet_cloud.dm index 25717cb22db..3b20d7c1361 100644 --- a/code/datums/components/pellet_cloud.dm +++ b/code/datums/components/pellet_cloud.dm @@ -335,7 +335,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_EXITED =.proc/grenade_uncrossed, ) - AddElement(/datum/element/connect_loc, parent, loc_connections) + AddElement(/datum/element/connect_loc_behalf, parent, loc_connections) /// Someone dropped the grenade, so set them to the shooter in case they're on top of it when it goes off /datum/component/pellet_cloud/proc/grenade_dropped(obj/item/nade, mob/living/slick_willy) diff --git a/code/datums/components/rot.dm b/code/datums/components/rot.dm index ff262e63930..2ad6c7abddf 100644 --- a/code/datums/components/rot.dm +++ b/code/datums/components/rot.dm @@ -37,7 +37,7 @@ RegisterSignal(parent, list(COMSIG_ATOM_HULK_ATTACK, COMSIG_ATOM_ATTACK_ANIMAL, COMSIG_ATOM_ATTACK_HAND), .proc/rot_react_touch) RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/rot_hit_react) if(ismovable(parent)) - AddElement(/datum/element/connect_loc, parent, loc_connections) + AddElement(/datum/element/connect_loc_behalf, parent, loc_connections) RegisterSignal(parent, COMSIG_MOVABLE_BUMP, .proc/rot_react) if(isliving(parent)) RegisterSignal(parent, COMSIG_LIVING_REVIVE, .proc/react_to_revive) //mobs stop this when they come to life @@ -60,7 +60,7 @@ /datum/component/rot/UnregisterFromParent() . = ..() if(ismovable(parent)) - RemoveElement(/datum/element/connect_loc, parent, loc_connections) + RemoveElement(/datum/element/connect_loc_behalf, parent, loc_connections) ///One of two procs that modifies blockers, this one handles removing a blocker and potentially restarting the rot /datum/component/rot/proc/start_up(blocker_type) diff --git a/code/datums/components/singularity.dm b/code/datums/components/singularity.dm index 58468a8e27a..d193f5aa6c3 100644 --- a/code/datums/components/singularity.dm +++ b/code/datums/components/singularity.dm @@ -85,7 +85,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, parent, loc_connections) + AddElement(/datum/element/connect_loc_behalf, parent, loc_connections) RegisterSignal(parent, COMSIG_ATOM_BULLET_ACT, .proc/consume_bullets) diff --git a/code/datums/components/slippery.dm b/code/datums/components/slippery.dm index 562070c099b..30eeb1fea78 100644 --- a/code/datums/components/slippery.dm +++ b/code/datums/components/slippery.dm @@ -33,7 +33,7 @@ if(slot_whitelist) src.slot_whitelist = slot_whitelist if(ismovable(parent)) - AddElement(/datum/element/connect_loc, parent, default_connections) + AddElement(/datum/element/connect_loc_behalf, parent, default_connections) if(isitem(parent)) RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip) @@ -69,7 +69,7 @@ if((!LAZYLEN(slot_whitelist) || (slot in slot_whitelist)) && isliving(equipper)) holder = equipper - AddElement(/datum/element/connect_loc, holder, holder_connections) + AddElement(/datum/element/connect_loc_behalf, holder, holder_connections) RegisterSignal(holder, COMSIG_PARENT_PREQDELETED, .proc/holder_deleted) /* @@ -96,7 +96,7 @@ SIGNAL_HANDLER UnregisterSignal(user, COMSIG_PARENT_PREQDELETED) - RemoveElement(/datum/element/connect_loc, holder, holder_connections) + RemoveElement(/datum/element/connect_loc_behalf, holder, holder_connections) holder = null /* @@ -115,8 +115,8 @@ /datum/component/slippery/UnregisterFromParent() . = ..() if(holder) - RemoveElement(/datum/element/connect_loc, holder, holder_connections) - RemoveElement(/datum/element/connect_loc, parent, default_connections) + RemoveElement(/datum/element/connect_loc_behalf, holder, holder_connections) + RemoveElement(/datum/element/connect_loc_behalf, parent, default_connections) /// Used for making the clown PDA only slip if the clown is wearing his shoes and the elusive banana-skin belt /datum/component/slippery/clowning diff --git a/code/datums/components/squeak.dm b/code/datums/components/squeak.dm index ba70aeb3f69..fae56d026c7 100644 --- a/code/datums/components/squeak.dm +++ b/code/datums/components/squeak.dm @@ -33,7 +33,7 @@ if(ismovable(parent)) RegisterSignal(parent, list(COMSIG_MOVABLE_BUMP, COMSIG_MOVABLE_IMPACT, COMSIG_PROJECTILE_BEFORE_FIRE), .proc/play_squeak) - AddElement(/datum/element/connect_loc, parent, item_connections) + AddElement(/datum/element/connect_loc_behalf, parent, item_connections) RegisterSignal(parent, COMSIG_MOVABLE_DISPOSING, .proc/disposing_react) if(isitem(parent)) RegisterSignal(parent, list(COMSIG_ITEM_ATTACK, COMSIG_ITEM_ATTACK_OBJ, COMSIG_ITEM_HIT_REACT), .proc/play_squeak) @@ -67,7 +67,7 @@ /datum/component/squeak/UnregisterFromParent() . = ..() - RemoveElement(/datum/element/connect_loc, parent, item_connections) + RemoveElement(/datum/element/connect_loc_behalf, parent, item_connections) /datum/component/squeak/proc/play_squeak() SIGNAL_HANDLER diff --git a/code/datums/components/swarming.dm b/code/datums/components/swarming.dm index 67212846c69..7c70500cced 100644 --- a/code/datums/components/swarming.dm +++ b/code/datums/components/swarming.dm @@ -14,8 +14,7 @@ offset_x = rand(-max_x, max_x) offset_y = rand(-max_y, max_y) - - AddElement(/datum/element/connect_loc, parent, swarming_loc_connections) + AddElement(/datum/element/connect_loc_behalf, parent, swarming_loc_connections) /datum/component/swarming/Destroy() for(var/other in swarm_members) diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 912ffe8fd07..8e1fad41c2f 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -117,6 +117,14 @@ qdel(C, FALSE, TRUE) dc.Cut() + clear_signal_refs() + //END: ECS SHIT + + return QDEL_HINT_QUEUE + +///Only override this if you know what you're doing. You do not know what you're doing +///This is a threat +/datum/proc/clear_signal_refs() var/list/lookup = comp_lookup if(lookup) for(var/sig in lookup) @@ -132,9 +140,6 @@ for(var/target in signal_procs) UnregisterSignal(target, signal_procs[target]) - //END: ECS SHIT - - return QDEL_HINT_QUEUE #ifdef DATUMVAR_DEBUGGING_MODE /datum/proc/save_vars() diff --git a/code/datums/elements/atmos_sensitive.dm b/code/datums/elements/atmos_sensitive.dm index 7aee3dd2c19..ca676327e26 100644 --- a/code/datums/elements/atmos_sensitive.dm +++ b/code/datums/elements/atmos_sensitive.dm @@ -10,7 +10,7 @@ if(!isatom(target)) //How return ELEMENT_INCOMPATIBLE var/atom/to_track = target - to_track.AddElement(/datum/element/connect_loc, to_track, pass_on) + to_track.AddElement(/datum/element/connect_loc, pass_on) RegisterSignal(to_track, COMSIG_MOVABLE_MOVED, .proc/react_to_move) if(!mapload && isopenturf(to_track.loc)) diff --git a/code/datums/elements/caltrop.dm b/code/datums/elements/caltrop.dm index 38ebb77251f..4c46a7b40d6 100644 --- a/code/datums/elements/caltrop.dm +++ b/code/datums/elements/caltrop.dm @@ -35,7 +35,7 @@ src.flags = flags if(ismovable(target)) - AddElement(/datum/element/connect_loc, target, crossed_connections) + AddElement(/datum/element/connect_loc_behalf, target, crossed_connections) else RegisterSignal(get_turf(target), COMSIG_ATOM_ENTERED, .proc/on_entered) @@ -95,4 +95,4 @@ /datum/element/caltrop/Detach(datum/target) . = ..() if(ismovable(target)) - RemoveElement(/datum/element/connect_loc, target, crossed_connections) + RemoveElement(/datum/element/connect_loc_behalf, target, crossed_connections) diff --git a/code/datums/elements/connect_loc.dm b/code/datums/elements/connect_loc.dm index d207af50b4c..6837fd9a0b0 100644 --- a/code/datums/elements/connect_loc.dm +++ b/code/datums/elements/connect_loc.dm @@ -1,6 +1,53 @@ /// This element hooks a signal onto the loc the current object is on. /// When the object moves, it will unhook the signal and rehook it to the new object. /datum/element/connect_loc + element_flags = ELEMENT_BESPOKE + id_arg_index = 2 + + /// An assoc list of signal -> procpath to register to the loc this object is on. + var/list/connections + +/datum/element/connect_loc/Attach(atom/movable/listener, list/connections) + . = ..() + if (!istype(listener)) + return ELEMENT_INCOMPATIBLE + + src.connections = connections + + RegisterSignal(listener, COMSIG_MOVABLE_MOVED, .proc/on_moved, override = TRUE) + update_signals(listener) + +/datum/element/connect_loc/Detach(atom/movable/listener) + . = ..() + unregister_signals(listener, listener.loc) + UnregisterSignal(listener, COMSIG_MOVABLE_MOVED) + +/datum/element/connect_loc/proc/update_signals(atom/movable/listener) + var/atom/listener_loc = listener.loc + if(isnull(listener_loc)) + return + + for (var/signal in connections) + //override=TRUE because more than one connect_loc element instance tracked object can be on the same loc + listener.RegisterSignal(listener_loc, signal, connections[signal], override=TRUE) + +/datum/element/connect_loc/proc/unregister_signals(datum/listener, atom/old_loc) + if(isnull(old_loc)) + return + + for (var/signal in connections) + listener.UnregisterSignal(old_loc, signal) + +/datum/element/connect_loc/proc/on_moved(atom/movable/listener, atom/old_loc) + SIGNAL_HANDLER + unregister_signals(listener, old_loc) + update_signals(listener) + +/// This element behaves the same as connect_loc, hooking into a signal on a tracked object's turf +/// It has the ability to react to that signal on behalf of a seperate listener however +/// This has great use, primarially for components, but it carries with it some overhead +/// So we do it seperately rather then intigrating the behavior with the main element +/datum/element/connect_loc_behalf element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH | ELEMENT_COMPLEX_DETACH id_arg_index = 3 @@ -10,14 +57,7 @@ /// An assoc list of locs that are being occupied and a list of targets that occupy them. var/list/targets = list() - /// The callback used when the turf under the tracked object changes - var/datum/callback/changeturf_callback - -/datum/element/connect_loc/New() - . = ..() - changeturf_callback = CALLBACK(src, .proc/post_turf_change) - -/datum/element/connect_loc/Attach(datum/listener, atom/movable/tracked, list/connections) +/datum/element/connect_loc_behalf/Attach(datum/listener, atom/movable/tracked, list/connections) . = ..() if (!istype(tracked)) return ELEMENT_INCOMPATIBLE @@ -27,7 +67,7 @@ RegisterSignal(tracked, COMSIG_MOVABLE_MOVED, .proc/on_moved, override = TRUE) update_signals(listener, tracked) -/datum/element/connect_loc/Detach(datum/listener, atom/movable/tracked, list/connections) +/datum/element/connect_loc_behalf/Detach(datum/listener, atom/movable/tracked, list/connections) . = ..() if(!tracked) @@ -36,7 +76,7 @@ unregister_signals(listener, tracked, tracked.loc) UnregisterSignal(tracked, COMSIG_MOVABLE_MOVED) -/datum/element/connect_loc/proc/update_signals(datum/listener, atom/movable/tracked) +/datum/element/connect_loc_behalf/proc/update_signals(datum/listener, atom/movable/tracked) var/existing = length(targets[tracked.loc]) if(!existing) targets[tracked.loc] = list() @@ -49,10 +89,7 @@ listener.RegisterSignal(tracked.loc, signal, connections[signal], override=TRUE) //override=TRUE because more than one connect_loc element instance tracked object can be on the same loc - if (!existing && isturf(tracked.loc)) - RegisterSignal(tracked.loc, COMSIG_TURF_CHANGE, .proc/on_turf_change) - -/datum/element/connect_loc/proc/unregister_all(datum/listener) +/datum/element/connect_loc_behalf/proc/unregister_all(datum/listener) for(var/atom/location as anything in targets) var/list/loc_targets = targets[location] for(var/atom/movable/tracked as anything in loc_targets) @@ -64,7 +101,7 @@ continue UnregisterSignal(tracked, COMSIG_MOVABLE_MOVED) -/datum/element/connect_loc/proc/unregister_signals(datum/listener, atom/movable/tracked, atom/old_loc) +/datum/element/connect_loc_behalf/proc/unregister_signals(datum/listener, atom/movable/tracked, atom/old_loc) if (length(targets[old_loc]) <= 1) targets -= old_loc else @@ -77,34 +114,9 @@ for (var/signal in connections) listener.UnregisterSignal(old_loc, signal) - if (!targets[old_loc] && isturf(old_loc)) - UnregisterSignal(old_loc, COMSIG_TURF_CHANGE) - -/datum/element/connect_loc/proc/on_moved(atom/movable/tracked, atom/old_loc) +/datum/element/connect_loc_behalf/proc/on_moved(atom/movable/tracked, atom/old_loc) SIGNAL_HANDLER - var/datum/listener = targets[old_loc][tracked] unregister_signals(listener, tracked, old_loc) update_signals(listener, tracked) -/datum/element/connect_loc/proc/on_turf_change( - turf/source, - path, - new_baseturfs, - flags, - list/post_change_callbacks, -) - SIGNAL_HANDLER - - post_change_callbacks += changeturf_callback - -/datum/element/connect_loc/proc/post_turf_change(turf/new_turf) - // If we don't cut the targets list before iterating, - // then we won't re-register the change turf signal. - var/list/turf_targets = targets[new_turf] - var/list/targets_copy = turf_targets.Copy() - turf_targets.Cut() - - for (var/atom/movable/tracked as anything in targets_copy) - var/datum/listener = targets_copy[tracked] - update_signals(listener, tracked) diff --git a/code/datums/elements/decals/_decal.dm b/code/datums/elements/decals/_decal.dm index a20ec939340..3a00e321d3d 100644 --- a/code/datums/elements/decals/_decal.dm +++ b/code/datums/elements/decals/_decal.dm @@ -118,6 +118,7 @@ /datum/element/decal/Detach(atom/source) UnregisterSignal(source, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_COMPONENT_CLEAN_ACT, COMSIG_PARENT_EXAMINE, COMSIG_ATOM_UPDATE_OVERLAYS, COMSIG_TURF_ON_SHUTTLE_MOVE, COMSIG_ATOM_SMOOTHED_ICON)) + SSdcs.UnregisterSignal(source, COMSIG_ATOM_DIR_CHANGE) source.update_appearance(UPDATE_OVERLAYS) if(isitem(source)) INVOKE_ASYNC(source, /obj/item/.proc/update_slot_icon) diff --git a/code/datums/elements/squashable.dm b/code/datums/elements/squashable.dm index 7a9614a3852..92d0b5e6aa4 100644 --- a/code/datums/elements/squashable.dm +++ b/code/datums/elements/squashable.dm @@ -27,7 +27,7 @@ if(!src.on_squash_callback && squash_callback) on_squash_callback = CALLBACK(parent, squash_callback) - AddElement(/datum/element/connect_loc, parent, loc_connections) + AddElement(/datum/element/connect_loc_behalf, parent, loc_connections) ///Handles the squashing of the mob /datum/component/squashable/proc/on_entered(turf/source_turf, atom/movable/crossing_movable) @@ -72,4 +72,4 @@ /datum/component/squashable/UnregisterFromParent() . = ..() - RemoveElement(/datum/element/connect_loc, parent, loc_connections) + RemoveElement(/datum/element/connect_loc_behalf, parent, loc_connections) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 556c82f84e6..7586996d18e 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -173,7 +173,7 @@ var/static/list/connections = list( COMSIG_ATOM_ATTACK_HAND = .proc/on_attack_hand ) - AddElement(/datum/element/connect_loc, src, connections) + AddElement(/datum/element/connect_loc, connections) return INITIALIZE_HINT_LATELOAD diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 2200ef208f4..41c04a84ad6 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -270,7 +270,7 @@ COMSIG_ATOM_EXIT = .proc/on_exit, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/machinery/door/firedoor/border_only/CanAllowThrough(atom/movable/mover, turf/target) . = ..() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 50791b95666..be894d04691 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -46,7 +46,7 @@ COMSIG_ATOM_EXIT = .proc/on_exit, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) AddElement(/datum/element/atmos_sensitive, mapload) /obj/machinery/door/window/ComponentInitialize() diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index adc6abbc4da..11f76527718 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -43,7 +43,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/machinery/recycler/RefreshParts() var/amt_made = 0 diff --git a/code/game/machinery/scan_gate.dm b/code/game/machinery/scan_gate.dm index 1f7151d8e41..9fd3f0d8519 100644 --- a/code/game/machinery/scan_gate.dm +++ b/code/game/machinery/scan_gate.dm @@ -59,7 +59,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/machinery/scanner_gate/Destroy() qdel(wires) diff --git a/code/game/machinery/teambuilder.dm b/code/game/machinery/teambuilder.dm index 9fc700b56be..e409cd7d800 100644 --- a/code/game/machinery/teambuilder.dm +++ b/code/game/machinery/teambuilder.dm @@ -20,7 +20,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/machinery/teambuilder/examine_more(mob/user) . = ..() diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index d1b503f46a4..6addf60eccf 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -107,7 +107,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/anomaly/grav/anomalyEffect() ..() @@ -178,7 +178,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/anomaly/flux/anomalyEffect() ..() diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index 82ad80b1531..97c9fa9a765 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -36,7 +36,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/decal/cleanable/Destroy() var/turf/T = get_turf(src) diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index d1f5c740138..39bec7c16c9 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -130,7 +130,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/particle_effect/smoke/bad/smoke_mob(mob/living/carbon/M) . = ..() diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index ccca78e9026..76324d585a8 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -21,7 +21,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/mine/examine(mob/user) . = ..() diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index b48318df433..d759b260722 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -86,7 +86,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/portal/singularity_pull() return diff --git a/code/game/objects/effects/powerup.dm b/code/game/objects/effects/powerup.dm index e9da2872e5b..5ca06d9f812 100644 --- a/code/game/objects/effects/powerup.dm +++ b/code/game/objects/effects/powerup.dm @@ -22,7 +22,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/powerup/proc/on_entered(datum/source, atom/movable/movable_atom) SIGNAL_HANDLER diff --git a/code/game/objects/effects/proximity.dm b/code/game/objects/effects/proximity.dm index b4a5bbccae8..c2251960838 100644 --- a/code/game/objects/effects/proximity.dm +++ b/code/game/objects/effects/proximity.dm @@ -111,7 +111,7 @@ COMSIG_ATOM_ENTERED = .proc/on_entered, COMSIG_ATOM_EXITED =.proc/on_uncrossed, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/abstract/proximity_checker/proc/on_uncrossed(datum/source, atom/movable/gone, direction) SIGNAL_HANDLER diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 5fb7edc5765..a0b89054233 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -12,7 +12,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/step_trigger/proc/Trigger(atom/movable/A) return 0 diff --git a/code/game/objects/items/devices/pressureplates.dm b/code/game/objects/items/devices/pressureplates.dm index 08f1edd189b..3af0cad4760 100644 --- a/code/game/objects/items/devices/pressureplates.dm +++ b/code/game/objects/items/devices/pressureplates.dm @@ -35,7 +35,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/pressure_plate/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 9b9a0a58d16..d7a477c7a36 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -323,7 +323,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/spring_trap, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/restraints/legcuffs/beartrap/update_icon_state() icon_state = "[initial(icon_state)][armed]" diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 0eabae36e03..8f967a4b9db 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -295,7 +295,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/shard/Destroy() . = ..() diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index f01771a7ce4..b1c5f47c792 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -83,7 +83,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /** Sets the amount of materials per unit for this stack. * diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 4f7aa397219..691cd08018c 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -539,7 +539,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/toy/snappop/proc/on_entered(datum/source, H as mob|obj) SIGNAL_HANDLER diff --git a/code/game/objects/structures/industrial_lift.dm b/code/game/objects/structures/industrial_lift.dm index e8f16ad556a..2aee21541aa 100644 --- a/code/game/objects/structures/industrial_lift.dm +++ b/code/game/objects/structures/industrial_lift.dm @@ -166,7 +166,7 @@ GLOBAL_LIST_EMPTY(lifts) COMSIG_ATOM_ENTERED = .proc/AddItemOnLift, COMSIG_ATOM_CREATED = .proc/AddItemOnLift, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) RegisterSignal(src, COMSIG_MOVABLE_BUMP, .proc/GracefullyBreak) if(!lift_master_datum) diff --git a/code/game/objects/structures/railings.dm b/code/game/objects/structures/railings.dm index a6e9b2bbb2b..770b97783cc 100644 --- a/code/game/objects/structures/railings.dm +++ b/code/game/objects/structures/railings.dm @@ -82,7 +82,7 @@ COMSIG_ATOM_EXIT = .proc/on_exit, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/railing/proc/on_exit(datum/source, atom/movable/leaving, direction) SIGNAL_HANDLER diff --git a/code/game/objects/structures/shower.dm b/code/game/objects/structures/shower.dm index 27556b828e8..50670d12daa 100644 --- a/code/game/objects/structures/shower.dm +++ b/code/game/objects/structures/shower.dm @@ -43,7 +43,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/machinery/shower/examine(mob/user) . = ..() diff --git a/code/game/objects/structures/stairs.dm b/code/game/objects/structures/stairs.dm index 382b09c2081..9bbc9bc258a 100644 --- a/code/game/objects/structures/stairs.dm +++ b/code/game/objects/structures/stairs.dm @@ -38,7 +38,7 @@ COMSIG_ATOM_EXIT = .proc/on_exit, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) return ..() diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 4fba931d0d8..44eb68dd4de 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -327,7 +327,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/table/glass/Destroy() QDEL_LIST(debris) diff --git a/code/game/objects/structures/traps.dm b/code/game/objects/structures/traps.dm index a3545776559..21678d18ad5 100644 --- a/code/game/objects/structures/traps.dm +++ b/code/game/objects/structures/traps.dm @@ -28,7 +28,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) if(!ignore_typecache) ignore_typecache = typecacheof(list( diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 5f81480cdd6..7399cf7e6b4 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -39,7 +39,7 @@ COMSIG_ATOM_EXIT = .proc/on_exit, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/windoor_assembly/Destroy() set_density(FALSE) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index a44be2b57cb..23507d70bb5 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -74,7 +74,7 @@ ) if (flags_1 & ON_BORDER_1) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/window/ComponentInitialize() . = ..() diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 209615379f3..b281f9fe42d 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -97,8 +97,19 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( changing_turf = TRUE qdel(src) //Just get the side effects and call Destroy + //We do this here so anything that doesn't want to persist can clear itself + var/list/old_comp_lookup = comp_lookup?.Copy() + var/list/old_signal_procs = signal_procs?.Copy() var/turf/W = new path(src) + // WARNING WARNING + // Turfs DO NOT lose their signals when they get replaced, REMEMBER THIS + // It's possible because turfs are fucked, and if you have one in a list and it's replaced with another one, the list ref points to the new turf + if(old_comp_lookup) + LAZYOR(W.comp_lookup, old_comp_lookup) + if(old_signal_procs) + LAZYOR(W.signal_procs, old_signal_procs) + for(var/datum/callback/callback as anything in post_change_callbacks) callback.InvokeAsync(W) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index af6ada3a194..66d014faf52 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -5,6 +5,7 @@ GLOBAL_LIST_EMPTY(station_turfs) icon = 'icons/turf/floors.dmi' vis_flags = VIS_INHERIT_ID | VIS_INHERIT_PLANE// Important for interaction with and visualization of openspace. luminosity = 1 + /// Turf bitflags, see code/__DEFINES/flags.dm var/turf_flags = NONE var/intact = 1 @@ -163,6 +164,13 @@ GLOBAL_LIST_EMPTY(station_turfs) vis_contents.Cut() +/// WARNING WARNING +/// Turfs DO NOT lose their signals when they get replaced, REMEMBER THIS +/// It's possible because turfs are fucked, and if you have one in a list and it's replaced with another one, the list ref points to the new turf +/// We do it because moving signals over was needlessly expensive, and bloated a very commonly used bit of code +/turf/clear_signal_refs() + return + /turf/attack_hand(mob/user, list/modifiers) . = ..() if(.) diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 250a989f09f..398c435e652 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -845,7 +845,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/table/optable/abductor/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 88f6a99be0d..5fafda4df03 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -234,7 +234,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/beam/i_beam/proc/on_entered(datum/source, atom/movable/AM as mob|obj) SIGNAL_HANDLER diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index a68aabbaca7..648e1d1d0fd 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -19,7 +19,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/assembly/mousetrap/examine(mob/user) . = ..() @@ -47,11 +47,11 @@ /obj/item/assembly/mousetrap/on_attach() . = ..() - AddElement(/datum/element/connect_loc, holder, holder_connections) + AddElement(/datum/element/connect_loc_behalf, holder, holder_connections) /obj/item/assembly/mousetrap/on_detach() . = ..() - RemoveElement(/datum/element/connect_loc, holder, holder_connections) + RemoveElement(/datum/element/connect_loc_behalf, holder, holder_connections) /obj/item/assembly/mousetrap/proc/triggered(mob/target, type = "feet") if(!armed) diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index 62a15dc7f28..a7436c8a5ef 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -8,9 +8,9 @@ /turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) return -/** - * Handles the creation of hotspots and initial activation of turfs. - * Setting the conditions for the reaction to actually happen for gasmixtures +/** + * Handles the creation of hotspots and initial activation of turfs. + * Setting the conditions for the reaction to actually happen for gasmixtures * is handled by the hotspot itself, specifically perform_exposure(). */ /turf/open/hotspot_expose(exposed_temperature, exposed_volume, soh) @@ -48,7 +48,7 @@ /** - * Hotspot objects interfaces with the temperature of turf gasmixtures while also providing visual effects. + * Hotspot objects interfaces with the temperature of turf gasmixtures while also providing visual effects. * One important thing to note about hotspots are that they can roughly be divided into two categories based on the bypassing variable. */ /obj/effect/hotspot @@ -64,7 +64,7 @@ light_color = LIGHT_COLOR_FIRE /** - * Volume is the representation of how big and healthy a fire is. + * Volume is the representation of how big and healthy a fire is. * Hotspot volume will be divided by turf volume to get the ratio for temperature setting on non bypassing mode. * Also some visual stuffs for fainter fires. */ @@ -91,17 +91,17 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /** * Perform interactions between the hotspot and the gasmixture. * * For the first tick, hotspots will take a sample of the air in the turf, - * set the temperature equal to a certain amount, and then reacts it. + * set the temperature equal to a certain amount, and then reacts it. * In some implementations the ratio comes out to around 1, so all of the air in the turf. * - * Afterwards if the reaction is big enough it mostly just tags along the fire, - * copying the temperature and handling the colouring. + * Afterwards if the reaction is big enough it mostly just tags along the fire, + * copying the temperature and handling the colouring. * If the reaction is too small it will perform like the first tick. * * Also calls fire_act() which handles burning. @@ -197,8 +197,8 @@ #define INSUFFICIENT(path) (!location.air.gases[path] || location.air.gases[path][MOLES] < 0.5) -/** - * Regular process proc for hotspots governed by the controller. +/** + * Regular process proc for hotspots governed by the controller. * Handles the calling of perform_exposure() which handles the bulk of temperature processing. * Burning or fire_act() are also called by perform_exposure(). * Also handles the dying and qdeletion of the hotspot and hotspot creations on adjacent cardinal turfs. diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 0761b6d96b1..7f2e9dbae05 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -131,7 +131,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/meatgrinder/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/modules/awaymissions/super_secret_room.dm b/code/modules/awaymissions/super_secret_room.dm index 680d4cd7ba1..2e19ca9c3d4 100644 --- a/code/modules/awaymissions/super_secret_room.dm +++ b/code/modules/awaymissions/super_secret_room.dm @@ -131,7 +131,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/rupee/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index d10c32293a4..7eb1cf52cad 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -208,7 +208,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/clothing/glasses/regular/proc/on_entered(datum/source, atom/movable/movable) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 53df8055469..990c6ca94d4 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -336,7 +336,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) AddElement(/datum/element/atmos_sensitive, mapload) /obj/structure/spacevine/examine(mob/user) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 9207af23c26..a819012284d 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -1329,7 +1329,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/hallucination/danger/lava/show_icon() image = image('icons/turf/floors/lava.dmi', src, "lava-0", TURF_LAYER) @@ -1350,7 +1350,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/hallucination/danger/chasm/show_icon() var/turf/target_loc = get_turf(target) @@ -1377,7 +1377,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/hallucination/danger/anomaly/process(delta_time) if(DT_PROB(45, delta_time)) diff --git a/code/modules/hydroponics/grown/towercap.dm b/code/modules/hydroponics/grown/towercap.dm index c8e01f3ee20..4ba19a1bba1 100644 --- a/code/modules/hydroponics/grown/towercap.dm +++ b/code/modules/hydroponics/grown/towercap.dm @@ -179,7 +179,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/bonfire/attackby(obj/item/W, mob/living/user, params) if(istype(W, /obj/item/stack/rods) && !can_buckle && !grill) diff --git a/code/modules/hydroponics/hydroitemdefines.dm b/code/modules/hydroponics/hydroitemdefines.dm index 86b486b9cc1..441926106a4 100644 --- a/code/modules/hydroponics/hydroitemdefines.dm +++ b/code/modules/hydroponics/hydroitemdefines.dm @@ -421,7 +421,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/cultivator/rake/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/modules/mining/equipment/resonator.dm b/code/modules/mining/equipment/resonator.dm index bf97faf7d59..a5a33aabf3a 100644 --- a/code/modules/mining/equipment/resonator.dm +++ b/code/modules/mining/equipment/resonator.dm @@ -69,7 +69,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/burst, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) . = ..() creator = set_creator res = set_resonator diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 19a39418fa4..26669a4171e 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -37,7 +37,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) AddElement(/datum/element/atmos_sensitive, mapload) /obj/item/clothing/mask/facehugger/lamarr diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b8417294b83..859576a0ff5 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -28,7 +28,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /mob/living/carbon/human/proc/setup_human_dna() //initialize dna. for spawned humans; overwritten by other code diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index b03af800d14..0bc368f0dc7 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -116,7 +116,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /mob/living/simple_animal/bot/cleanbot/Destroy() if(weapon) diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm index 67cd466d357..faa43fa2852 100644 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm @@ -49,7 +49,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /mob/living/simple_animal/bot/honkbot/proc/limiting_spam_false() //used for addtimer limiting_spam = FALSE diff --git a/code/modules/mob/living/simple_animal/bot/hygienebot.dm b/code/modules/mob/living/simple_animal/bot/hygienebot.dm index d5e22600187..a01ecdaa70f 100644 --- a/code/modules/mob/living/simple_animal/bot/hygienebot.dm +++ b/code/modules/mob/living/simple_animal/bot/hygienebot.dm @@ -49,7 +49,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /mob/living/simple_animal/bot/hygienebot/explode() walk_to(src,0) diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 994e23bd7d2..83600bd7b42 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -90,7 +90,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /mob/living/simple_animal/bot/secbot/Destroy() QDEL_NULL(weapon) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 286aeae1e88..fc52993ad67 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -41,7 +41,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /mob/living/simple_animal/mouse/add_cell_sample() AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOUSE, CELL_VIRUS_TABLE_GENERIC_MOB, 1, 10) diff --git a/code/modules/mob/living/simple_animal/guardian/types/fire.dm b/code/modules/mob/living/simple_animal/guardian/types/fire.dm index 011058b84c1..68828e60abf 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/fire.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/fire.dm @@ -19,7 +19,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /mob/living/simple_animal/hostile/guardian/fire/Life(delta_time = SSMOBS_DT, times_fired) . = ..() diff --git a/code/modules/mob/living/simple_animal/guardian/types/ranged.dm b/code/modules/mob/living/simple_animal/guardian/types/ranged.dm index 09532c12322..3b01dd85c59 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/ranged.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/ranged.dm @@ -115,7 +115,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/snare/proc/on_entered(datum/source, AM as mob|obj) SIGNAL_HANDLER diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm index 553a01b84cc..85c57cb3076 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm @@ -85,7 +85,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/leaper_bubble/ComponentInitialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 8e797fb87c7..cb0ad0c30f9 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -659,7 +659,7 @@ Difficulty: Hard var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/temp_visual/hierophant/blast/damaging/proc/blast() var/turf/T = get_turf(src) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/legionnaire.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/legionnaire.dm index 4018070d179..90103ef4691 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/legionnaire.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/legionnaire.dm @@ -284,7 +284,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/legionnaire_bonfire/proc/on_entered(datum/source, atom/movable/mover) SIGNAL_HANDLER diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/frog.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/frog.dm index 873091fff03..c009539e20a 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/frog.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/frog.dm @@ -46,7 +46,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /mob/living/simple_animal/hostile/retaliate/frog/proc/on_entered(datum/source, AM as mob|obj) SIGNAL_HANDLER diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index 4c03c38060e..914f50cb668 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -77,7 +77,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/ebeam/vine/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/modules/plumbing/plumbers/fermenter.dm b/code/modules/plumbing/plumbers/fermenter.dm index ff23b6625eb..c7469e5ad8a 100644 --- a/code/modules/plumbing/plumbers/fermenter.dm +++ b/code/modules/plumbing/plumbers/fermenter.dm @@ -16,7 +16,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/machinery/plumbing/grinder_chemical/can_be_rotated(mob/user, rotation_type) if(anchored) diff --git a/code/modules/plumbing/plumbers/grinder_chemical.dm b/code/modules/plumbing/plumbers/grinder_chemical.dm index eff5cbed069..0e35002355e 100644 --- a/code/modules/plumbing/plumbers/grinder_chemical.dm +++ b/code/modules/plumbing/plumbers/grinder_chemical.dm @@ -15,7 +15,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/machinery/plumbing/grinder_chemical/can_be_rotated(mob/user, rotation_type) if(anchored) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 3366da24034..eb8c62592c0 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -924,7 +924,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/item/light/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index 0cb718b349b..8c391db6f5e 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -24,7 +24,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/machinery/field/containment/Destroy() FG1.fields -= src diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 7e92b54a105..49b6acd794c 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -177,7 +177,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/projectile/proc/Range() range-- diff --git a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm index 508586bcef7..b26a7256deb 100644 --- a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm +++ b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm @@ -50,7 +50,7 @@ COMSIG_ATOM_EXIT = .proc/on_exit, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/necropolis_gate/Destroy(force) if(force) @@ -264,7 +264,7 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate) var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/stone_tile/Destroy(force) if(force || fallen) diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index 63bbdf1fdfb..e5e9b999b13 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -200,7 +200,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/table/wood/bar/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/modules/spells/spell_types/spacetime_distortion.dm b/code/modules/spells/spell_types/spacetime_distortion.dm index 2623dfec194..714cf1e28da 100644 --- a/code/modules/spells/spell_types/spacetime_distortion.dm +++ b/code/modules/spells/spell_types/spacetime_distortion.dm @@ -87,7 +87,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/cross_action/spacetime_dist/proc/walk_link(atom/movable/AM) if(ismob(AM)) diff --git a/code/modules/swarmers/swarmer_objs.dm b/code/modules/swarmers/swarmer_objs.dm index 68c97bc10a7..63f92d85d5c 100644 --- a/code/modules/swarmers/swarmer_objs.dm +++ b/code/modules/swarmers/swarmer_objs.dm @@ -135,7 +135,7 @@ var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = .proc/on_entered, ) - AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/connect_loc, loc_connections) /obj/structure/swarmer/trap/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/modules/unit_tests/connect_loc.dm b/code/modules/unit_tests/connect_loc.dm index 7569ba25e03..99fea41b3fc 100644 --- a/code/modules/unit_tests/connect_loc.dm +++ b/code/modules/unit_tests/connect_loc.dm @@ -66,7 +66,7 @@ COMSIG_MOCK_SIGNAL = .proc/on_receive_mock_signal, ) - AddElement(/datum/element/connect_loc, src, connections) + AddElement(/datum/element/connect_loc, connections) /obj/item/watches_mock_calls/proc/on_receive_mock_signal(datum/source) SIGNAL_HANDLER