diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index c6e3562bd97..51821f14641 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -10,6 +10,8 @@ SUBSYSTEM_DEF(mapping) var/list/teleportlocs /// List of all areas that can be accessed via IC and OOC means var/list/ghostteleportlocs + ///List of areas that exist on the station this shift + var/list/existing_station_areas // This has to be here because world/New() uses [station_name()], which looks this datum up /datum/controller/subsystem/mapping/PreInit() @@ -89,6 +91,13 @@ SUBSYSTEM_DEF(mapping) ghostteleportlocs = sortAssoc(ghostteleportlocs) + // Now we make a list of areas that exist on the station. Good for if you don't want to select areas that exist for one station but not others. Directly references + existing_station_areas = list() + for(var/area/AR in world) + var/turf/picked = safepick(get_area_turfs(AR.type)) + if(picked && is_station_level(picked.z)) + existing_station_areas += AR + // World name if(GLOB.configuration.general.server_name) world.name = "[GLOB.configuration.general.server_name]: [station_name()]" diff --git a/code/modules/events/anomaly.dm b/code/modules/events/anomaly.dm index a97abdd8e5a..fa2cdc07de0 100644 --- a/code/modules/events/anomaly.dm +++ b/code/modules/events/anomaly.dm @@ -5,13 +5,6 @@ /datum/event/anomaly/proc/findEventArea() var/static/list/allowed_areas - var/static/list/existing_areas - if(!existing_areas) - existing_areas = list() - for(var/area/AR in world) - var/turf/picked = safepick(get_area_turfs(AR.type)) - if(picked && is_station_level(picked.z)) - existing_areas += AR if(!allowed_areas) //Places that shouldn't explode var/list/safe_area_types = typecacheof(list( @@ -36,7 +29,7 @@ )) allowed_areas = typecacheof(GLOB.the_station_areas) - safe_area_types + unsafe_area_subtypes - var/list/possible_areas = typecache_filter_list(existing_areas, allowed_areas) + var/list/possible_areas = typecache_filter_list(SSmapping.existing_station_areas, allowed_areas) if(length(possible_areas)) return pick(possible_areas)