Prevents tick_check'ed sleeps/spawns from shutting out the MC

I don't know why I didn't do this before....
This commit is contained in:
Kyle Spier-Swenson
2017-01-04 22:38:35 -08:00
committed by GitHub
parent 73814c2274
commit 072ea7b03a
+5 -1
View File
@@ -232,6 +232,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
while (1)
tickdrift = max(0, MC_AVERAGE_FAST(tickdrift, (((world.timeofday - init_timeofday) - (world.time - init_time)) / world.tick_lag)))
if (processing <= 0)
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
sleep(10)
continue
@@ -239,6 +240,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
// because sleeps are processed in the order received, so longer sleeps are more likely to run first
if (world.tick_usage > TICK_LIMIT_MC)
sleep_delta += 2
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.5)
sleep(world.tick_lag * (processing + sleep_delta))
continue
@@ -267,6 +269,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
if (!error_level)
iteration++
error_level++
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
sleep(10)
continue
@@ -278,6 +281,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
if (!error_level)
iteration++
error_level++
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
sleep(10)
continue
error_level--
@@ -288,6 +292,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
iteration++
last_run = world.time
src.sleep_delta = MC_AVERAGE_FAST(src.sleep_delta, sleep_delta)
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.25) //reserve the tail 1/4 of the next tick for the mc.
sleep(world.tick_lag * (processing + sleep_delta))
@@ -445,7 +450,6 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
return
queue_node = queue_node.queue_next
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
. = 1
//resets the queue, and all subsystems, while filtering out the subsystem lists