Caches all unique areas so that they are properly loaded in (#16092)

This commit is contained in:
Farie82
2021-05-26 23:41:35 +02:00
committed by GitHub
parent bfc5895c7d
commit ebf7d7911e
3 changed files with 10 additions and 1 deletions
+1
View File
@@ -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.
+6
View File
@@ -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 = ""
@@ -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]