Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AiFloodMovementAndRange loop issue. #8

Open
Huichelaar opened this issue Feb 1, 2025 · 1 comment
Open

AiFloodMovementAndRange loop issue. #8

Huichelaar opened this issue Feb 1, 2025 · 1 comment

Comments

@Huichelaar
Copy link

The new AiFloodMovementAndRange seems to call AddMap with the unit's X and Y pos, instead of the X and Y iterated on in the loop:

C-SkillSys:

AddMap(unit->xPos, unit->yPos, mask);

Decomp:
https://github.com/FireEmblemUniverse/fireemblem8u/blob/master/src/cp_battle.c#L263

As a result, the RangeMap does not get properly filled. This can cause the issue where units with AI2 = 0x6 do not move to targets within 2*mov. There's a discussion with someone who ran into this problem in the FEU discord:
https://discordapp.com/channels/144670830150811649/179027738454261760/1334728969161015357

Suggested solution: use ix and iy instead of unit->xPos and unit->yPos.

@MokhaLeee
Copy link
Collaborator

6c80916

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

No branches or pull requests

2 participants