fheroes2
fheroes2 copied to clipboard
Battle screen, AI can't reach a troop which stands near canyon
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
Save file
Additional info
No response
Hi @Branikolog , can you provide a video or screenshots what exactly doesn't work? For me it looks fine.
Hi, @ihhub !
The problem on the second screenshot is quite evident, but here's another one. I hope it's more clear. :)
"Turn 1000"
Are you sure they weren't planning to make a move on turn 1001?
Hi @Branikolog. Could this be related to how the Dragon is a flyer? Would it happen if your creature does not take up 2 hexes?
The problem is in pathfinding. More specifically in std::pair<int, uint32_t> Battle::Arena::CalculateMoveToUnit( const Unit & target ) const
method which has incorrect cached information about cells.
The conditions to reproduce this issue: a monster should be not reachable for AI monster at current turn and this monster must be standing in between 2 unreachable cells: