Repository navigation
battle: match BattleUpdateUnitMasks - #266
Merged
Merged
Conversation
Xeeynamo
approved these changes
Oct 5, 2026
Xeeynamo
left a comment
Owner
There was a problem hiding this comment.
Left a comment for a potential follow-up
| stateFlags = g_BattleState.combatant[i].stateFlags; | ||
| status = g_BattleState.combatant[i].status; | ||
|
|
||
| if (stateFlags & 8) { |
Owner
There was a problem hiding this comment.
We need an enum for this at some point.
Contributor
Author
There was a problem hiding this comment.
Agreed, I want to work towards understanding these stateFlags better.
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.
Added symbol size to g_BattleSceneContext. Wasn't 100% sure on the unnamed locals, but I think var_t3 represents targetable actors, and var_s1 are those driven by AI scripts (stateFlags & 0x8/0x10, respectively). Pretty sure 0xF and 0x3F0 are masks for the party and enemies. I'll add constants for these in a separate cleanup pass.
The last loop is what needed the BattleData refactor. unk174 was offset locally from unitZoneMask in the asm, and while I found a nested dummy struct that matched, it seemed pretty unnatural. Given what we know about the PC build, the BattleData struct is a much simpler solution that fits neatly.