bug(time-attack): timer can underflow to negative values #55
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
The Time Attack countdown timer in
time_attack_plugin.rsdecrements bydelta_secondseach frame without clamping to zero. If a frame takes longer than the remaining time (e.g. a hitch or background process), the timer ticks past zero into negative territory before the game-over logic fires on the next frame.Affected file
solitaire_engine/src/time_attack_plugin.rsFix
Clamp the timer value to
0.0after subtraction:Then trigger game-over when
remaining.0 <= 0.0.