AI hero gets stuck in an infinite loop jumping between 2 castles
Preliminary checks
- [X] I've checked that there aren't other open issues on the same topic.
- [X] I've checked that this issue is reproducible on the latest snapshot build.
Platform
Windows
Describe the bug
AI hero goes into an infinite loop while using Town Portal and jumping between 2 castles. Load the save file to pass the control to AI.
Save file
Additional info
No response
This issue requires implementation of #7139 in order to avoid such a behavior.
This issue requires implementation of https://github.com/ihhub/fheroes2/issues/7139 in order to avoid such a behavior.
Hi @ihhub could you please explain in more detail how #7139 is related to the Town Portal spell? Please also note that as soon as Solmyr hires enough troops, he stops jumping from castle to castle and attacks the wandering stack of dwarves nearby, so it's not "endless" at all - he just has nothing to do until he hires more troops.
Hi @oleg-derevenetz , I actually realized that AI heroes do start their turn by executing an action when they are in castles. So yes, you are right.
I don't think that we can improve this behavior at the moment.