[pull] master from beyond-all-reason:master - #226
Merged
Conversation
### Work done Fix the order menu showing an enemy unit as "Fire at will" again after changing its fire state in godmode and reselecting it, even when the unit received the command. `Spring.GetUnitStates` can return no value for enemy units because godmode control does not grant allied read access. The shared fire-state reader previously converted that missing value to "Fire at will". Only when `Spring.IsGodModeEnabled()` is true, it now falls back to the unit's fire-state command description and returns nil if neither source is available. Custom fire-state rules parameters retain priority. With godmode disabled, the previous behavior is preserved, including the default for unavailable states; no command descriptions are queried by the fallback. #### Test steps - [x] Reproduced the incorrect fallback with mocked Spring APIs before the fix; nine Lua checks cover own/enemy units, all four engine fire states, custom Defend priority, and missing/invalid units. - [x] 120 additional mocked checks compare godmode-disabled results against the implementation before this PR, covering valid/invalid units, both modoption settings, available/missing engine states and custom rules states. All match, and the fallback never queries command descriptions without godmode. - [x] `stylua --check modules/custom_firestate_defs.lua` and `git diff --check` pass. - [ ] In a local game with cheats and godmode enabled, select an enemy unit, change its fire state, deselect and reselect it. Verify the menu keeps showing the actual state. Repeat with left/right click and an own-team unit, then with godmode disabled. In-game validation is still pending. ### AI / LLM usage statement OpenAI Codex investigated the bug, implemented the change, ran the mocked checks, and prepared this PR.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )