From e05c7151af0c89921d6cc4e0fadd701ebaa7cad0 Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Tue, 31 Aug 2021 19:01:20 -0400 Subject: [PATCH] Makes anomalies able to spawn in more areas --- code/modules/events/anomaly.dm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/code/modules/events/anomaly.dm b/code/modules/events/anomaly.dm index c806fac3ce0..17ad79ef0c7 100644 --- a/code/modules/events/anomaly.dm +++ b/code/modules/events/anomaly.dm @@ -5,6 +5,11 @@ /datum/event/anomaly/proc/findEventArea() var/static/list/allowed_areas + var/static/list/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( @@ -20,10 +25,16 @@ ) //Subtypes from the above that actually should explode. - var/list/unsafe_area_subtypes = typecacheof(list(/area/engine/break_room)) + var/list/unsafe_area_subtypes = typecacheof(list( + /area/engine/break_room, + /area/engine/equipmentstorage, + /area/engine/chiefs_office, + /area/engine/controlroom, + /area/engine/mechanic_workshop + )) - allowed_areas = make_associative(GLOB.the_station_areas) - safe_area_types + unsafe_area_subtypes - var/list/possible_areas = typecache_filter_list(GLOB.all_areas, allowed_areas) + allowed_areas = typecacheof(GLOB.the_station_areas) - safe_area_types + unsafe_area_subtypes + var/list/possible_areas = typecache_filter_list(existing_areas, allowed_areas) if(length(possible_areas)) return pick(possible_areas)