[X] I've checked that there aren't other open issues on the same topic.
Describe the problem requiring a solution
In fheroes2, optimize the hero's path, taking into account the destination reached on the next turn.
In the example, the hero will reach the gems mine the following turn.
For the hero's path, for the current day (green arrows), we can see that the hero's last step is taken horizontally.
On the following turn, we can see that the hero will make a diagonal move to reach the gems mine (the last step to reach the brown cross).
If the proposed path is followed, the next turn the hero will have 1050 movement points left when he reaches the gems mine.
Now, if the path is optimized by making a diagonal move for the hero's last step, the hero will have 1100 movement points left when he reaches the gems mine.
Preliminary checks
Describe the problem requiring a solution
In fheroes2, optimize the hero's path, taking into account the destination reached on the next turn.
In the example, the hero will reach the gems mine the following turn. For the hero's path, for the current day (green arrows), we can see that the hero's last step is taken horizontally. On the following turn, we can see that the hero will make a diagonal move to reach the gems mine (the last step to reach the brown cross). If the proposed path is followed, the next turn the hero will have 1050 movement points left when he reaches the gems mine. Now, if the path is optimized by making a diagonal move for the hero's last step, the hero will have 1100 movement points left when he reaches the gems mine.
In fheroes2:
Default path, 1050 movement points left.![Path optimize 01 004](https://github.com/ihhub/fheroes2/assets/43583994/66decbeb-9efd-4a04-8d57-8ee2915184d4)
Optimized path, 1100 movement points left.![Path optimize 01 005](https://github.com/ihhub/fheroes2/assets/43583994/959b9e08-e85d-403b-8c72-002f91d3ea92)
Here is the save file: Path optimize 01.zip
Describe the possible solution
Optimize the hero's path, taking into account the destination reached on the next turn.
Additional info
No response