Moves existing_station_areas to SSmapping, to prevent midround lag

This commit is contained in:
Qwertytoforty
2021-09-16 14:04:07 -04:00
parent b5df23090f
commit 23b74b126d
2 changed files with 10 additions and 8 deletions
+1 -8
View File
@@ -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)