Adds runtime detection to the atmos ticker. 20 ticks of runtimes, total, will kill atmos.

This commit is contained in:
SkyMarshal
2012-05-13 22:14:53 -07:00
parent c54d44517e
commit c7133a17a7

View File

@@ -104,6 +104,7 @@ datum
var/current_cycle = 0
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()
@@ -211,9 +212,17 @@ datum
set background = 1
while(1)
if(kill_air)
return 1
if(!kill_air)
current_cycle++
var/success = tick() //Changed so that a runtime does not crash the ticker.
if(!success) //Runtimed.
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))
proc/tick()
if(groups_to_rebuild.len > 0) //If there are groups to rebuild, do so.
spawn process_rebuild_select_groups()
@@ -228,7 +237,11 @@ datum
AG.process_group()
for(var/turf/simulated/T in active_singletons) //Processing Singletons
spawn T.process_cell()
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()
@@ -243,7 +256,8 @@ datum
spawn
if(AG) // Because of runtime errors on syphoning.
AG.check_regroup()
sleep(max(5,update_delay*tick_multiplier))
return 1
proc/process_rebuild_select_groups()
//Purpose: This gets called to recalculate and rebuild group geometry