From 096c4a0e10cff8204e0778d6a47e62cec1bc06ad Mon Sep 17 00:00:00 2001 From: Sutures <101909198+noelle-lavenza@users.noreply.github.com> Date: Sun, 8 Mar 2026 08:12:24 -0400 Subject: [PATCH] Fix bugs with area contents system (#95337) ## About The Pull Request Contains two changes cherry-picked from my CM PR, https://github.com/cmss13-devs/cmss13/pull/11826. 1) Fixes incorrect args to `block()` in `increase_max_y()` that caused it to add turfs to every z-level's world.area contents list instead of just the correct one. This is probably left over from when the area contents list wasn't split by z-level. 2) Avoids a case where turfs could be removed from area contents twice if the subsystem returned early on a later Z-level. ## Why It's Good For The Game Fixes two bugs with the area contents system. ## Changelog :cl: MoondancerPony fix: fixed turfs sometimes not being in any area's contents /:cl: --- code/controllers/subsystem/area_contents.dm | 2 ++ code/game/world.dm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/area_contents.dm b/code/controllers/subsystem/area_contents.dm index 11e07eac55b..830c6857561 100644 --- a/code/controllers/subsystem/area_contents.dm +++ b/code/controllers/subsystem/area_contents.dm @@ -63,6 +63,8 @@ SUBSYSTEM_DEF(area_contents) if(MC_TICK_CHECK) cut_from.Cut(1, amount_cut + 1) return + // avoid double removals if we return early on a subsequent z-level + clear.turfs_to_uncontain_by_zlevel[area_zlevel] = list() clear.turfs_to_uncontain_by_zlevel = list() marked_for_clearing.len-- diff --git a/code/game/world.dm b/code/game/world.dm index 9a81e19d97f..e2370fedb1f 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -484,8 +484,8 @@ GLOBAL_VAR(restart_counter) LISTASSERTLEN(global_area.turfs_by_zlevel, map_load_z_cutoff, list()) for (var/zlevel in 1 to map_load_z_cutoff) var/list/to_add = block( - 1, old_maxy + 1, 1, - maxx, maxy, map_load_z_cutoff + 1, old_maxy + 1, zlevel, + maxx, maxy, zlevel ) global_area.turfs_by_zlevel[zlevel] += to_add