ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.7k stars 375 forks source link

The boat wipes out part of the whirlpool when the hero who was in it disembarks #9141

Open oleg-derevenetz opened 2 weeks ago

oleg-derevenetz commented 2 weeks ago

Preliminary checks

Platform

Windows

Describe the bug

Found during testing #9140. On the master branch:

https://github.com/user-attachments/assets/7330fecc-44aa-4621-9c1c-59a110a4e733

After the hero disembarks from a boat located on one of the tiles of the whirlpool, the OBJ_BOAT replaces the OBJ_WHIRLPOOL on that tile. On the master branch, another hero is still able to teleport to that tile with the OBJ_BOAT. If the hero gets back into the boat and sails away from the whirlpool, the whirlpool object on that tile is not being restored, but another hero still can teleport to it:

https://github.com/user-attachments/assets/5f6d66a2-6b57-4761-b843-78ba96aca4e4

With the fixes from #9140, the situation is a little different - OBJ_BOAT still replaces the OBJ_WHIRLPOOL upon disembarking, but another hero cannot teleport to that tile anymore (regardless of whether it's occupied with the boat or not):

https://github.com/user-attachments/assets/126e2320-9a2c-4ec6-bcd9-ece111e41564

Save file

Test map:

!!TEST1.zip

Additional info

No response

oleg-derevenetz commented 1 week ago

Hi @ihhub none of my PRs are intended to fix this :) This is not a pathfinder issue, but rather an issue related to map internals, as I see it, since a map tile is not able to hold two objects at the same time (just like that issue with a pickupable object on a coast). I would like to suggest someone who understands the map internals to take a look.