From ebf7d7911e2989bdc90ff53ae004f01b4b23cbe8 Mon Sep 17 00:00:00 2001 From: Farie82 Date: Wed, 26 May 2021 23:41:35 +0200 Subject: [PATCH] Caches all unique areas so that they are properly loaded in (#16092) --- code/_globalvars/lists/objects.dm | 1 + code/game/area/areas.dm | 6 ++++++ code/modules/awaymissions/maploader/reader.dm | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index ab3bfa85451..4c22d37dc32 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -18,6 +18,7 @@ GLOBAL_LIST_INIT(cell_logs, list()) GLOBAL_LIST_INIT(navigation_computers, list()) GLOBAL_LIST_INIT(all_areas, list()) +GLOBAL_LIST_INIT(all_unique_areas, list()) // List of all unique areas. AKA areas with there_can_be_many = FALSE GLOBAL_LIST_INIT(machines, list()) GLOBAL_LIST_INIT(rcd_list, list()) //list of Rapid Construction Devices. diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 6565779e14b..e8e08609e82 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -75,6 +75,12 @@ ///Used to decide what the maximum time between ambience is var/max_ambience_cooldown = 90 SECONDS +/area/New(loc, ...) + if(!there_can_be_many) // Has to be done in New else the maploader will fuck up and find subtypes for the parent + GLOB.all_unique_areas[type] = src + ..() + + /area/Initialize(mapload) GLOB.all_areas += src icon_state = "" diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index 533947d58e3..5b5eb26e27f 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -475,7 +475,9 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new()) if(initial(A.there_can_be_many)) area_list[A] = new A else - area_list[A] = locate(A) + if(!GLOB.all_unique_areas[A]) + GLOB.all_unique_areas[A] = new A // No locate here else it will find a subtype of the one we're looking for + area_list[A] = GLOB.all_unique_areas[A] return area_list[A]