bugfix(gameengine): Prevent logic time accumulation while the game is halted#2865
Open
bobtista wants to merge 4 commits into
Open
bugfix(gameengine): Prevent logic time accumulation while the game is halted#2865bobtista wants to merge 4 commits into
bobtista wants to merge 4 commits into
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Source/Common/GameEngine.cpp | Adds an early return when regular-game logic timing is halted. |
| GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp | Mirrors the halted regular-game logic guard for Zero Hour. |
Reviews (2): Last reviewed commit: "bugfix(gameengine): Check for halted gam..." | Re-trigger Greptile
|
It also broke pause on mismatch partially, because fast forward overrides pause now. |
Caball009
reviewed
Jul 10, 2026
Comment on lines
+708
to
+714
| // TheSuperHackers @bugfix bobtista 08/07/2026 Return early when the logic time scale fps is zero, | ||
| // otherwise the accumulator banks the paused duration and replays it at render rate after unpausing. | ||
| if (logicTimeScaleFps <= 0) | ||
| { | ||
| return false; | ||
| } | ||
|
|
There was a problem hiding this comment.
This should go after
const Int logicTimeScaleFps = TheFramePacer->getActualLogicTimeScaleFps(logicTimeQueryFlags);otherwise this function returns true when replay mode is enabled & the game is paused & fast forward is enabled.
It doesn't need a comment as far as I'm concerned, because it's our own function and straightforward what it does and why it does it.
Author
There was a problem hiding this comment.
Ah good catch, pause should now win and work right in fast forward, and it fixes pause on mismatch
…e is not overridden
…e is not overridden (Generals)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #2803 the update no longer passes
FramePacer::IgnoreHaltedGame, sogetActualLogicTimeScaleFpsreturns 0 while the game is paused. That makestargetFrameTimeinfinite, andm_logicTimeAccumulatorbanks the entire pause duration, which then drains at render rate after unpausing — the game runs at 2x for about as long as it was paused.Now returns early when the logic time scale fps is 0, leaving the accumulator untouched while the game is halted, so the game resumes at normal speed.
Todo: