There was an error while loading. Please reload this page.
1 parent 9f73b1a commit 0746689Copy full SHA for 0746689
1 file changed
server/src/main/kotlin/dev/robocode/tankroyale/server/core/ResettableTimer.kt
@@ -118,6 +118,7 @@ class ResettableTimer(
118
synchronized(lock) {
119
if (!active || isPaused()) return
120
pauseStartTimeNanos = System.nanoTime()
121
+ generation += 1
122
cancelScheduled()
123
}
124
@@ -136,6 +137,8 @@ class ResettableTimer(
136
137
val remainingMin = (minDelayNanos - elapsed).coerceAtLeast(0L)
138
139
val delay = if (ready) remainingMin else remainingMax
140
+ // Note: generation was already incremented in pause(), so any tasks
141
+ // that fired during the pause are already ignored by executeIfValid()
142
scheduleInternal(delay, generation)
143
144
0 commit comments