From d2d618c618f9184a9d65b68beec3d5b2059f2ef6 Mon Sep 17 00:00:00 2001 From: Mal <13398309+vinylspiders@users.noreply.github.com> Date: Fri, 19 Jan 2024 10:34:39 -0500 Subject: [PATCH] Modular updates --- .../automapper/code/area_spawn_subsystem.dm | 39 ++++++++++--------- .../code/structures/technologists_lectern.dm | 9 +++-- .../modules/decay_subsystem/code/decaySS.dm | 9 +++-- modular_nova/modules/mold/code/mold_event.dm | 17 ++++---- 4 files changed, 40 insertions(+), 34 deletions(-) diff --git a/modular_nova/modules/automapper/code/area_spawn_subsystem.dm b/modular_nova/modules/automapper/code/area_spawn_subsystem.dm index f95548cb50c..358dc8c29fb 100644 --- a/modular_nova/modules/automapper/code/area_spawn_subsystem.dm +++ b/modular_nova/modules/automapper/code/area_spawn_subsystem.dm @@ -91,11 +91,12 @@ SUBSYSTEM_DEF(area_spawn) turf_list = area_turf_info["[mode]"] = list() // Get highest priority items - for(var/turf/iterating_turf as anything in area.get_contained_turfs()) - // Only retain turfs of the highest priority - var/priority = process_turf(iterating_turf, mode) - if(priority > 0) - LAZYADDASSOC(turf_list, "[priority]", list(iterating_turf)) + for(var/list/zlevel_turfs as anything in area.get_zlevel_turf_lists()) + for(var/turf/iterating_turf as anything in zlevel_turfs) + // Only retain turfs of the highest priority + var/priority = process_turf(iterating_turf, mode) + if(priority > 0) + LAZYADDASSOC(turf_list, "[priority]", list(iterating_turf)) // Sort the priorities descending return sortTim(turf_list, GLOBAL_PROC_REF(cmp_num_string_asc)) @@ -333,17 +334,18 @@ SUBSYSTEM_DEF(area_spawn) if(!found_area) continue - for(var/turf/candidate_turf as anything in found_area.get_contained_turfs()) - // Don't spawn if there's already a desired_atom here. - if(is_type_on_turf(candidate_turf, desired_atom)) - continue + for(var/list/zlevel_turfs as anything in found_area.get_zlevel_turf_lists()) + for(var/turf/candidate_turf as anything in zlevel_turfs) + // Don't spawn if there's already a desired_atom here. + if(is_type_on_turf(candidate_turf, desired_atom)) + continue - for(var/over_atom_type in over_atoms) - // Spawn on the first one we find in the turf and stop. - if(is_type_on_turf(candidate_turf, over_atom_type)) - new desired_atom(candidate_turf) - // Break the over_atom_type loop. - break + for(var/over_atom_type in over_atoms) + // Spawn on the first one we find in the turf and stop. + if(is_type_on_turf(candidate_turf, over_atom_type)) + new desired_atom(candidate_turf) + // Break the over_atom_type loop. + break /obj/effect/turf_test name = "PASS" @@ -361,9 +363,10 @@ SUBSYSTEM_DEF(area_spawn) set name = "Test Area Spawner" set desc = "Show area spawner placement candidates as an overlay." - for(var/turf/area_turf as anything in area.get_contained_turfs()) - for(var/obj/effect/turf_test/old_test in area_turf) - qdel(old_test) + for(var/list/zlevel_turfs as anything in area.get_zlevel_turf_lists()) + for(var/turf/area_turf as anything in zlevel_turfs) + for(var/obj/effect/turf_test/old_test in area_turf) + qdel(old_test) SSarea_spawn.clear_cache() for(var/mode in 0 to AREA_SPAWN_MODE_COUNT - 1) diff --git a/modular_nova/modules/clock_cult/code/structures/technologists_lectern.dm b/modular_nova/modules/clock_cult/code/structures/technologists_lectern.dm index fbbb8de5e4f..11759912286 100644 --- a/modular_nova/modules/clock_cult/code/structures/technologists_lectern.dm +++ b/modular_nova/modules/clock_cult/code/structures/technologists_lectern.dm @@ -428,10 +428,11 @@ apc_loop: for(var/obj/machinery/power/apc/controller as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/power/apc)) var/area/apc_area = get_area(controller) // make sure that no "critical" APCs lose their power (SM, namely) - for(var/turf/turf as anything in apc_area.get_contained_turfs()) - for(var/obj/machinery/depowered_machinery in turf) - if(depowered_machinery.critical_machine) - continue apc_loop + for(var/list/zlevel_turfs as anything in apc_area.get_zlevel_turf_lists()) + for(var/turf/turf as anything in zlevel_turfs) + for(var/obj/machinery/depowered_machinery in turf) + if(depowered_machinery.critical_machine) + continue apc_loop controller.cell?.charge = 0 diff --git a/modular_nova/modules/decay_subsystem/code/decaySS.dm b/modular_nova/modules/decay_subsystem/code/decaySS.dm index c3b59c479c0..d2c141f8b26 100644 --- a/modular_nova/modules/decay_subsystem/code/decaySS.dm +++ b/modular_nova/modules/decay_subsystem/code/decaySS.dm @@ -56,10 +56,11 @@ SUBSYSTEM_DEF(decay) possible_areas += iterating_area // Now add the turfs - for(var/turf/iterating_turf as anything in iterating_area.get_contained_turfs()) - if(!(iterating_turf.flags_1 & CAN_BE_DIRTY_1)) - continue - possible_turfs += iterating_turf + for(var/list/zlevel_turfs as anything in iterating_area.get_zlevel_turf_lists()) + for(var/turf/iterating_turf as anything in zlevel_turfs) + if(!(iterating_turf.flags_1 & CAN_BE_DIRTY_1)) + continue + possible_turfs += iterating_turf if(!possible_turfs) CRASH("SSDecay had no possible turfs to use!") diff --git a/modular_nova/modules/mold/code/mold_event.dm b/modular_nova/modules/mold/code/mold_event.dm index 7c8f32caff0..8c97b8328b0 100644 --- a/modular_nova/modules/mold/code/mold_event.dm +++ b/modular_nova/modules/mold/code/mold_event.dm @@ -48,17 +48,18 @@ if(!is_type_in_typecache(checked_area, possible_spawn_areas)) continue - for(var/turf/open/floor in checked_area.get_contained_turfs()) - if(isopenspaceturf(floor)) - continue + for(var/list/zlevel_turfs as anything in checked_area.get_zlevel_turf_lists()) + for(var/turf/open/floor in zlevel_turfs) + if(isopenspaceturf(floor)) + continue - if(!floor.Enter(test_resin)) - continue + if(!floor.Enter(test_resin)) + continue - if(locate(/turf/closed) in range(2, floor)) - continue + if(locate(/turf/closed) in range(2, floor)) + continue - turfs += floor + turfs += floor qdel(test_resin)