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.69k stars 375 forks source link

Fix original maps bottom layer (hacky) placed resources and artifacts #8977

Closed Districh-ru closed 2 months ago

Districh-ru commented 2 months ago

Fix #8852

This PR fixes some issues for the original maps made by hack or some original editor bug when an action object is placed to the bottom player addons instead of the main main tile object.

It:

Important! This PR fixes only the new games, not the saved games

Such map "hacks" can be observed on the map LOSTRELI.MP2 ("Lost Relic"). Master build (the picked up artifact is not the same as shown on the map):

https://github.com/user-attachments/assets/05173434-780f-4c17-b246-4933b67d5a7a

This PR:

https://github.com/user-attachments/assets/1f513a08-b158-491f-92e6-c02df64c6ee4

The resource "hack" is noticeable of the map 4 of the Roland campaign.

https://github.com/user-attachments/assets/eded2889-988f-4b02-8408-b113eefa1af9

oleg-derevenetz commented 2 months ago

Such map "hacks" can be observed on the map LOSTRELI.MP2 ("Lost Relic"). Master build: [...video...] This PR: [...video...]

I didn't really understand exactly where to look here :) In both cases, the artifact is hidden behind the trees, as it should be.

Districh-ru commented 2 months ago

Such map "hacks" can be observed on the map LOSTRELI.MP2 ("Lost Relic"). Master build: [...video...] This PR: [...video...]

I didn't really understand exactly where to look here :) In both cases, the artifact is hidden behind the trees, as it should be.

Hi, @oleg-derevenetz, in master build the current random artifact can have any sprite (according to the randomly given artifact ID) but the metadata[0] will always be 11 and the picked up artifact type will always be the "Mages' Ring of Power". Yes, it is hard to see but on the tile behind the forest there is some other artifact sprite, not the "Mages' Ring of Power": изображение

Added: For the "Mages' Ring of Power" it will be: изображение

ihhub commented 2 months ago

@Districh-ru , a bunch of thanks for this update!