mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
Fix All Exoplanet Atmosphere Lag (#22924)
Y'know, probably. It certainly seems to work locally! changes: - code_imp: "Exoplanets now cache their main outdoor atmospheric region instead of trying to search their entire map once per second." - code_imp: "Exoplanet atmospheric calculations now run only when necessary using new update_revision counter." - code_imp: "Exoplanet atmospheres now wait until all random ruins have been placed before trying to resolve the air everywhere." - admin: "Adds new admin debug verb, 'Toggle Non-Horizon Temperature Graphics', which toggles all off-ship gas temp graphics to address lag in a pinch, if still necessary, without removing actual environmental hazard."
This commit is contained in:
@@ -88,6 +88,9 @@ SUBSYSTEM_DEF(air)
|
||||
var/active_zones = 0
|
||||
var/next_id = 1
|
||||
|
||||
/// Prevents gas temp graphics from being attached to turfs on non-Horizon z-levels.
|
||||
var/suppress_nonhorizon_temperature_graphics = FALSE
|
||||
|
||||
#ifdef ZASDBG
|
||||
var/updated = 0
|
||||
#endif
|
||||
@@ -297,6 +300,36 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
if (processing_zones)
|
||||
processing_zones -= z
|
||||
|
||||
/// Suppresses or restores temperature graphics on every currently loaded non-station z-level.
|
||||
/datum/controller/subsystem/air/proc/set_nonhorizon_temperature_graphics_suppressed(suppress)
|
||||
suppress_nonhorizon_temperature_graphics = suppress
|
||||
. = 0
|
||||
|
||||
for(var/z_level in 1 to world.maxz)
|
||||
if(is_station_level(z_level))
|
||||
continue
|
||||
|
||||
for(var/turf/simulated/T in Z_TURFS(z_level))
|
||||
var/list/temperature_graphics
|
||||
|
||||
if(suppress)
|
||||
for(var/obj/gas_overlay/graphic in T.vis_contents)
|
||||
if(graphic.gas_id == GAS_HEAT || graphic.gas_id == GAS_COLD)
|
||||
LAZYADD(temperature_graphics, graphic)
|
||||
else if(TURF_HAS_VALID_ZONE(T))
|
||||
for(var/obj/gas_overlay/graphic in T.zone.air.graphic)
|
||||
if(graphic.gas_id == GAS_HEAT || graphic.gas_id == GAS_COLD)
|
||||
LAZYADD(temperature_graphics, graphic)
|
||||
|
||||
if(LAZYLEN(temperature_graphics))
|
||||
if(suppress)
|
||||
T.update_graphic(graphic_remove = temperature_graphics)
|
||||
else
|
||||
T.update_graphic(graphic_add = temperature_graphics)
|
||||
. += length(temperature_graphics)
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
/datum/controller/subsystem/air/proc/air_blocked(turf/A, turf/B)
|
||||
#ifdef ZASDBG
|
||||
ASSERT(isturf(A))
|
||||
@@ -386,6 +419,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
return
|
||||
zones_to_update += Z
|
||||
Z.needs_update = 1
|
||||
Z.update_revision++
|
||||
|
||||
/datum/controller/subsystem/air/proc/mark_edge_sleeping(connection_edge/E)
|
||||
#ifdef ZASDBG
|
||||
|
||||
Reference in New Issue
Block a user