From 3d4f97ad561b1d0146c139d8abf0041ac7ccb7a4 Mon Sep 17 00:00:00 2001 From: FlufflesTheDog Date: Fri, 12 Jun 2026 13:35:23 -0700 Subject: [PATCH] Maploading cleans up empty areas (#96451) ## About The Pull Request Adds a check that, when loading a map file, deletes any areas which no longer contain any turfs. A similar check exists in the proc for manually adding/extending areas. This is important because it is assumed that when accessing an initialized unique area eg from areas_by_type, that it will have turfs. ## Why It's Good For The Game fixbug ## Changelog Not player facing --- code/modules/mapping/reader.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm index fcb5b445b41..e27984b5523 100644 --- a/code/modules/mapping/reader.dm +++ b/code/modules/mapping/reader.dm @@ -933,6 +933,8 @@ GLOBAL_LIST_EMPTY(map_model_default) old_area.turfs_to_uncontain_by_zlevel[crds.z] += crds area_instance.turfs_by_zlevel[crds.z] += crds area_instance.contents.Add(crds) + if(!isnull(old_area) && !old_area.has_contained_turfs()) + qdel(old_area) if(GLOB.use_preloader) world.preloader_load(area_instance)