mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 12:13:06 +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,9 +212,17 @@ 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(!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.
|
if(groups_to_rebuild.len > 0) //If there are groups to rebuild, do so.
|
||||||
spawn process_rebuild_select_groups()
|
spawn process_rebuild_select_groups()
|
||||||
|
|
||||||
@@ -228,7 +237,11 @@ datum
|
|||||||
AG.process_group()
|
AG.process_group()
|
||||||
|
|
||||||
for(var/turf/simulated/T in active_singletons) //Processing Singletons
|
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
|
for(var/turf/simulated/hot_potato in active_super_conductivity) //Process superconduction
|
||||||
spawn hot_potato.super_conduct()
|
spawn hot_potato.super_conduct()
|
||||||
@@ -243,7 +256,8 @@ datum
|
|||||||
spawn
|
spawn
|
||||||
if(AG) // Because of runtime errors on syphoning.
|
if(AG) // Because of runtime errors on syphoning.
|
||||||
AG.check_regroup()
|
AG.check_regroup()
|
||||||
sleep(max(5,update_delay*tick_multiplier))
|
return 1
|
||||||
|
|
||||||
|
|
||||||
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