Fix: Avoid timer scheduling too far events into short queue (#17348)

This commit is contained in:
Aziz Chynaliev
2022-01-19 21:18:08 +03:00
committed by GitHub
parent 24bf21e6d0
commit 387f66d7a6

View File

@@ -3,7 +3,7 @@
/// Helper for getting the correct bucket for a given timer
#define BUCKET_POS(timer) (((round((timer.timeToRun - SStimer.head_offset) / world.tick_lag)+1) % BUCKET_LEN)||BUCKET_LEN)
/// Gets the maximum time at which timers will be invoked from buckets, used for deferring to secondary queue
#define TIMER_MAX (world.time + TICKS2DS(min(BUCKET_LEN-(SStimer.practical_offset-DS2TICKS(world.time - SStimer.head_offset))-1, BUCKET_LEN-1)))
#define TIMER_MAX (SStimer.head_offset + TICKS2DS(BUCKET_LEN + SStimer.practical_offset - 1))
/// Max float with integer precision
#define TIMER_ID_MAX (2**24)