Skip to content

fix(script-engine): Count script timers at the legacy rate while time is frozen - #630

Open
Okladnoj wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
OKJID:okji/fix/script-timers-frozen-time
Open

Okladnoj wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
OKJID:okji/fix/script-timers-frozen-time

Conversation

@Okladnoj

@Okladnoj Okladnoj commented Oct 8, 2026

Copy link
Copy Markdown

With GENERALS_ONLINE_HIGH_FPS_SERVER the logic runs at 60 Hz and script timers tick only
when HasLegacyFrameAdvanced() is true, which follows the parity of m_frame.

While a script freezes time, GameLogic::update still runs the script engine every tick but
returns before m_frame++, so the flag stays whatever the frozen frame left it at:

  • an even frozen frame runs every script timer twice as fast (the briefing lines of MD_USA01
    start on top of each other);
  • an odd frozen frame stops the timers altogether.

ScriptEngine::hasLegacyTimerTickPassed() keeps HasLegacyFrameAdvanced() whenever the frame
moves and counts its own legacy ticks while the frame stands still. Normal and network play
are unchanged: time is never frozen by script in a network game.

… is frozen

- With GENERALS_ONLINE_HIGH_FPS_SERVER the logic runs at 60 Hz and script timers tick only when
  HasLegacyFrameAdvanced() is true, which is updated from the parity of m_frame
- While a script freezes time, GameLogic::update still runs the script engine every tick but
  returns before m_frame++, so the flag stays whatever the frozen frame left it at
- An even frozen frame ran every timer twice as fast (briefing lines of MD_USA01 started on
  top of each other), an odd one stopped the timers altogether
- ScriptEngine now counts its own legacy ticks while the frame stands still and keeps
  HasLegacyFrameAdvanced() whenever the frame moves, so normal and network play are unchanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant