mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 04:02:31 +00:00
Adds runtime detection to the atmos ticker. 20 ticks of runtimes, total, will kill atmos.
This commit is contained in:
@@ -104,6 +104,7 @@ datum
|
|||||||
|
|
||||||
var/current_cycle = 0
|
var/current_cycle = 0
|
||||||
var/update_delay = 5 //How long between check should it try to process atmos again.
|
var/update_delay = 5 //How long between check should it try to process atmos again.
|
||||||
|
var/failed_ticks = 0 //How many ticks have runtimed?
|
||||||
|
|
||||||
|
|
||||||
/* process()
|
/* process()
|
||||||
@@ -211,39 +212,52 @@ datum
|
|||||||
|
|
||||||
set background = 1
|
set background = 1
|
||||||
while(1)
|
while(1)
|
||||||
if(kill_air)
|
if(!kill_air)
|
||||||
return 1
|
current_cycle++
|
||||||
current_cycle++
|
var/success = tick() //Changed so that a runtime does not crash the ticker.
|
||||||
if(groups_to_rebuild.len > 0) //If there are groups to rebuild, do so.
|
if(!success) //Runtimed.
|
||||||
spawn process_rebuild_select_groups()
|
failed_ticks++
|
||||||
|
if(failed_ticks > 20)
|
||||||
|
world << "<font size='4' color='red'>ERROR IN ATMOS TICKER. Killing air simulation!</font>"
|
||||||
|
kill_air = 1
|
||||||
|
sleep(max(5,update_delay*tick_multiplier))
|
||||||
|
|
||||||
if(tiles_to_update.len > 0) //If there are tiles to update, do so.
|
proc/tick()
|
||||||
for(var/turf/simulated/T in tiles_to_update)
|
if(groups_to_rebuild.len > 0) //If there are groups to rebuild, do so.
|
||||||
spawn T.update_air_properties()
|
spawn process_rebuild_select_groups()
|
||||||
tiles_to_update = list()
|
|
||||||
|
|
||||||
for(var/datum/air_group/AG in air_groups) //Processing groups
|
if(tiles_to_update.len > 0) //If there are tiles to update, do so.
|
||||||
|
for(var/turf/simulated/T in tiles_to_update)
|
||||||
|
spawn T.update_air_properties()
|
||||||
|
tiles_to_update = list()
|
||||||
|
|
||||||
|
for(var/datum/air_group/AG in air_groups) //Processing groups
|
||||||
|
spawn
|
||||||
|
if(AG) // Because of runtime errors on syphoning.
|
||||||
|
AG.process_group()
|
||||||
|
|
||||||
|
for(var/turf/simulated/T in active_singletons) //Processing Singletons
|
||||||
|
spawn
|
||||||
|
if(istype(T))
|
||||||
|
T.process_cell()
|
||||||
|
else
|
||||||
|
active_singletons.Remove(T)
|
||||||
|
|
||||||
|
for(var/turf/simulated/hot_potato in active_super_conductivity) //Process superconduction
|
||||||
|
spawn hot_potato.super_conduct()
|
||||||
|
|
||||||
|
if(high_pressure_delta.len) //Process high pressure delta (airflow)
|
||||||
|
for(var/turf/pressurized in high_pressure_delta)
|
||||||
|
spawn pressurized.high_pressure_movements()
|
||||||
|
high_pressure_delta = list()
|
||||||
|
|
||||||
|
if(current_cycle%10==5) //Check for groups of tiles to resume group processing every 10 cycles
|
||||||
|
for(var/datum/air_group/AG in air_groups)
|
||||||
spawn
|
spawn
|
||||||
if(AG) // Because of runtime errors on syphoning.
|
if(AG) // Because of runtime errors on syphoning.
|
||||||
AG.process_group()
|
AG.check_regroup()
|
||||||
|
return 1
|
||||||
|
|
||||||
for(var/turf/simulated/T in active_singletons) //Processing Singletons
|
|
||||||
spawn T.process_cell()
|
|
||||||
|
|
||||||
for(var/turf/simulated/hot_potato in active_super_conductivity) //Process superconduction
|
|
||||||
spawn hot_potato.super_conduct()
|
|
||||||
|
|
||||||
if(high_pressure_delta.len) //Process high pressure delta (airflow)
|
|
||||||
for(var/turf/pressurized in high_pressure_delta)
|
|
||||||
spawn pressurized.high_pressure_movements()
|
|
||||||
high_pressure_delta = list()
|
|
||||||
|
|
||||||
if(current_cycle%10==5) //Check for groups of tiles to resume group processing every 10 cycles
|
|
||||||
for(var/datum/air_group/AG in air_groups)
|
|
||||||
spawn
|
|
||||||
if(AG) // Because of runtime errors on syphoning.
|
|
||||||
AG.check_regroup()
|
|
||||||
sleep(max(5,update_delay*tick_multiplier))
|
|
||||||
|
|
||||||
proc/process_rebuild_select_groups()
|
proc/process_rebuild_select_groups()
|
||||||
//Purpose: This gets called to recalculate and rebuild group geometry
|
//Purpose: This gets called to recalculate and rebuild group geometry
|
||||||
|
|||||||
Reference in New Issue
Block a user