Backports several SSmapping improvements (#17208)

* Optimizes SSmapping

* Turfs inside area are stored

https://github.com/tgstation/tgstation/pull/70966

* Add async reserving of turfs

* Fix bug

* Fix shuttle init
This commit is contained in:
Ling
2022-12-31 16:41:47 +01:00
committed by GitHub
parent 5a5be9ef89
commit 17c5a68c33
48 changed files with 1390 additions and 644 deletions

View File

@@ -30,7 +30,7 @@
allowed_areas = make_associative(GLOB.the_station_areas) - safe_area_types + unsafe_area_subtypes
return safepick(typecache_filter_list(GLOB.sortedAreas,allowed_areas))
return safepick(typecache_filter_list(GLOB.areas,allowed_areas))
/datum/round_event/anomaly/setup()
impact_area = findEventArea()
@@ -49,4 +49,4 @@
if(T)
newAnomaly = new anomaly_path(T)
if (newAnomaly)
announce_to_ghosts(newAnomaly)
announce_to_ghosts(newAnomaly)

View File

@@ -28,27 +28,24 @@
M.playsound_local(M, 'sound/ambience/aurora_caelus.ogg', 20, FALSE, pressure_affected = FALSE)
/datum/round_event/aurora_caelus/start()
for(var/area in GLOB.sortedAreas)
var/area/A = area
for(var/area/A as anything in GLOB.areas)
if(initial(A.dynamic_lighting) == DYNAMIC_LIGHTING_IFSTARLIGHT)
for(var/turf/open/space/S in A)
for(var/turf/open/space/S in A.get_contained_turfs())
S.set_light(S.light_range * 3, S.light_power * 2)
/datum/round_event/aurora_caelus/tick()
if(activeFor % 5 == 0)
aurora_progress++
var/aurora_color = aurora_colors[aurora_progress]
for(var/area in GLOB.sortedAreas)
var/area/A = area
for(var/area/A as anything in GLOB.areas)
if(initial(A.dynamic_lighting) == DYNAMIC_LIGHTING_IFSTARLIGHT)
for(var/turf/open/space/S in A)
for(var/turf/open/space/S in A.get_contained_turfs())
S.set_light(l_color = aurora_color)
/datum/round_event/aurora_caelus/end()
for(var/area in GLOB.sortedAreas)
var/area/A = area
for(var/area/A as anything in GLOB.areas)
if(initial(A.dynamic_lighting) == DYNAMIC_LIGHTING_IFSTARLIGHT)
for(var/turf/open/space/S in A)
for(var/turf/open/space/S in A.get_contained_turfs())
fade_to_black(S)
priority_announce("The aurora caelus event is now ending. Starlight conditions will slowly return to normal. When this has concluded, please return to your workplace and continue work as normal. Have a pleasant shift, [station_name()], and thank you for watching with us.",
sound = 'sound/misc/notice2.ogg',

View File

@@ -24,7 +24,7 @@
severity = rand(1,3)
for(var/i in 1 to severity)
var/picked_area = pick_n_take(potential_areas)
for(var/area/A in world)
for(var/area/A as anything in GLOB.areas)
if(istype(A, picked_area))
areasToOpen += A

View File

@@ -13,8 +13,8 @@
var/obj/structure/spacevine/SV = new()
for(var/area/maintenance/A in world)
for(var/turf/F in A)
for(var/area/maintenance/A in GLOB.areas)
for(var/turf/F as anything in A.get_contained_turfs())
if(F.Enter(SV))
turfs += F

View File

@@ -76,6 +76,6 @@
///Subtypes from the above that actually should explode.
var/list/unsafe_area_subtypes = typecacheof(list(/area/engine/break_room))
allowed_areas = make_associative(GLOB.the_station_areas) - safe_area_types + unsafe_area_subtypes
var/list/possible_areas = typecache_filter_list(GLOB.sortedAreas,allowed_areas)
var/list/possible_areas = typecache_filter_list(GLOB.areas, allowed_areas)
if (length(possible_areas))
return pick(possible_areas)