Fixes the dimensional rift being able to spawn in maintenance (#18954)

* Unifies findEventArea()

* Removes an unused area
This commit is contained in:
Adri
2022-09-07 14:38:48 +02:00
committed by GitHub
parent d8fed6808d
commit 5e8930bec0
3 changed files with 11 additions and 63 deletions
-29
View File
@@ -3,35 +3,6 @@
var/obj/effect/anomaly/anomaly_path = /obj/effect/anomaly/flux
announceWhen = 1
/datum/event/anomaly/proc/findEventArea()
var/static/list/allowed_areas
if(!allowed_areas)
//Places that shouldn't explode
var/list/safe_area_types = typecacheof(list(
/area/turret_protected/ai,
/area/turret_protected/ai_upload,
/area/ai_monitored/storage/emergency,
/area/engine,
/area/solar,
/area/holodeck,
/area/shuttle,
/area/maintenance,
/area/toxins/test_area)
)
//Subtypes from the above that actually should explode.
var/list/unsafe_area_subtypes = typecacheof(list(
/area/engine/break_room,
/area/engine/equipmentstorage,
/area/engine/chiefs_office,
/area/engine/controlroom
))
allowed_areas = typecacheof(GLOB.the_station_areas) - safe_area_types + unsafe_area_subtypes
var/list/possible_areas = typecache_filter_list(SSmapping.existing_station_areas, allowed_areas)
if(length(possible_areas))
return pick(possible_areas)
/datum/event/anomaly/setup()
impact_area = findEventArea()
if(!impact_area)
+11 -29
View File
@@ -19,47 +19,29 @@
return
/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
var/area/candidate = null
var/list/safe_areas = list(
var/list/safe_areas = typecacheof(list(
/area/turret_protected/ai,
/area/turret_protected/ai_upload,
/area/engine,
/area/solar,
/area/holodeck,
/area/shuttle/arrival,
/area/shuttle/escape,
/area/shuttle/escape_pod1/station,
/area/shuttle/escape_pod2/station,
/area/shuttle/escape_pod3/station,
/area/shuttle/escape_pod5/station,
/area/shuttle/specops/station,
/area/shuttle/prison/station,
/area/shuttle/administration/station
)
/area/shuttle,
/area/maintenance,
/area/toxins/test_area))
//These are needed because /area/engine has to be removed from the list, but we still want these areas to get fucked up.
var/list/danger_areas = list(
/area/engine/break_room,
/area/engine/chiefs_office)
/area/engine/equipmentstorage,
/area/engine/chiefs_office,
/area/engine/controlroom)
var/list/event_areas = list()
var/list/allowed_areas = list()
for(var/areapath in GLOB.the_station_areas)
event_areas += typesof(areapath)
for(var/areapath in safe_areas)
event_areas -= typesof(areapath)
for(var/areapath in danger_areas)
event_areas += typesof(areapath)
allowed_areas = typecacheof(GLOB.the_station_areas) - safe_areas + danger_areas
var/list/possible_areas = typecache_filter_list(SSmapping.existing_station_areas, allowed_areas)
while(event_areas.len > 0)
var/list/event_turfs = null
candidate = locate(pick_n_take(event_areas))
event_turfs = get_area_turfs(candidate)
if(event_turfs.len > 0)
break
return candidate
return pick(possible_areas)
// Returns how many characters are currently active(not logged out, not AFK for more than 10 minutes)
// with a specific role.