Repository navigation
DCIcon: use Spring.GetGameState for the lag state - #5884
Open
moss-orbit-9f339e wants to merge 1 commit into
Open
moss-orbit-9f339e wants to merge 1 commit into
moss-orbit-9f339e wants to merge 1 commit into
Conversation
The engine removed Spring.GetHasLag in 2019, so DrawScreen raised an error and the widget handler removed the widget at once. The fourth return value of Spring.GetGameState is the same lag state (CGame::IsSimLagging), as unit_start_state.lua already uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The engine removed
Spring.GetHasLagin 2019 (Recoil 13a636710e). Thus, the DCIcon widget raises an error inDrawScreenon its first frame, and the widget handler removes it. This change reads the lag state from the fourth return value ofSpring.GetGameState, which uses the same engine check (CGame::IsSimLagging).unit_start_state.luaalready reads it this way.104 crash reports in one year have this error.
Behaviour: the widget is off by default. When a player turns it on, it shows the icon when the game lags, as before 2019.
Testing (Windows, RTX 3080, master ee8950e):
dbg_dcicon.lua:102: attempt to call field 'GetHasLag' (a nil value), and the widget is removed. With this change, there is no error. The checksums and unit counts are the same.AI disclosure: Claude Code wrote this change and the tests. I reviewed the change.