Priority Tweaks (#4814)

Reworks all subsystem priorities to correspond with how the priority var is actually supposed to be used.

Relevant comment from MSO:
Prioritys are a weight that controls how much of the byond tick the subsystem will be allowed to have, 50 was the default, so a subsystem with a priority of 100 would be allocated twice the amount of runtime as normal, and 25 would get half the amount.

Also ports some minor MC micro-optimizations from TG.
This commit is contained in:
Lohikar
2018-06-01 15:43:39 -05:00
committed by Erki
parent 5d84f349e8
commit 4ca4332076
3 changed files with 41 additions and 38 deletions

View File

@@ -287,7 +287,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
continue
//Byond resumed us late. assume it might have to do the same next tick
if (last_run + Ceiling(world.tick_lag * (processing * sleep_delta), world.tick_lag) < world.time)
if (last_run + CEILING(world.tick_lag * (processing * sleep_delta), world.tick_lag) < world.time)
sleep_delta += 1
sleep_delta = MC_AVERAGE_FAST(sleep_delta, 1) //decay sleep_delta
@@ -373,7 +373,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
if (SS_flags & SS_NO_FIRE)
subsystemstocheck -= SS
continue
if (!(SS_flags & SS_TICKER) && (SS_flags & SS_KEEP_TIMING) && SS.last_fire + (SS.wait * 0.75) > world.time)
if ((SS_flags & (SS_TICKER|SS_KEEP_TIMING)) == SS_KEEP_TIMING && SS.last_fire + (SS.wait * 0.75) > world.time)
continue
SS.enqueue()
. = 1