mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-25 17:41:56 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user