mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-05-12 17:59:50 +01:00
Fix runtimes when events cannot find a valid event area (#26594)
* Fix runtimes when events cannot find a valid event area * oops
This commit is contained in:
@@ -194,6 +194,9 @@
|
||||
var/mess_count = rand(5, 10)
|
||||
for(var/i in 1 to mess_count)
|
||||
var/area/target_area = findEventArea()
|
||||
if(!target_area)
|
||||
log_debug("Failed to generate themed messes: No valid event areas were found.")
|
||||
return
|
||||
var/list/turfs = get_area_turfs(target_area)
|
||||
while(length(turfs))
|
||||
var/turf/T = pick_n_take(turfs)
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
var/list/remove_these_areas = safe_areas - allowed_areas
|
||||
var/list/possible_areas = typecache_filter_list_reverse(SSmapping.existing_station_areas, remove_these_areas)
|
||||
|
||||
if(!length(possible_areas))
|
||||
return null
|
||||
return pick(possible_areas)
|
||||
|
||||
/proc/findUnrestrictedEventArea() //Does almost the same as findEventArea() but hits a few more areas including maintenance and the AI sat, and also returns a list of all the areas, instead of just one area
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
impact_area = findEventArea()
|
||||
|
||||
/datum/event/tear/start()
|
||||
if(isnull(impact_area))
|
||||
log_debug("No valid event areas could be generated for dimensional tear.")
|
||||
var/list/area_turfs = get_area_turfs(impact_area)
|
||||
while(length(area_turfs))
|
||||
var/turf/T = pick_n_take(area_turfs)
|
||||
@@ -45,6 +47,9 @@
|
||||
if(!target_area)
|
||||
if(false_alarm)
|
||||
target_area = findEventArea()
|
||||
if(isnull(target_area))
|
||||
log_debug("Tried to announce a false-alarm tear without a valid area!")
|
||||
kill()
|
||||
else
|
||||
log_debug("Tried to announce a tear without a valid area!")
|
||||
kill()
|
||||
|
||||
Reference in New Issue
Block a user