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

Adventure map, faulty artifact being picked up causes forest to disappear temporary #8505

Closed Branikolog closed 2 months ago

Branikolog commented 6 months ago

Preliminary checks

Platform

Windows

Describe the bug

The artifact my hero is picking does not correspond the sprite we watch on the screen. Picking it up also causes forest to disappear during fading animation.

https://github.com/ihhub/fheroes2/assets/55348946/8a5f9614-456b-4c74-a64f-3cee61d2bc3f

I've checked on two separate games - there's always a magic ring. But this could be a coincidence though.

Save file

Lost_Relic_artifact issue.zip

Additional info

No response

ihhub commented 6 months ago

This is the problem of object removal logic.

Branikolog commented 6 months ago

Actually, this map (Lost Relic) has multiple places, where artifacts were placed on improper places. If I'm not mistaken we were already fixed some issue on this map: an artifact was placed on an improper cell somewhere in swamps.

ihhub commented 6 months ago

As expected this is due to object positioning on this tile:

******* Tile info *******
Tile index      : 1502, point: (62, 20)
MP2 object type : 169 (Artifact)
UID             : 1181
ICN object type : 43 (TREFIR.ICN)
image index     : 22
layer type      : 0 - Object layer
is shadow       : no
region          : 4
ground          : Grass (isRoad: 0)
ground img index: 72, image flags: 0
passable from   : center, top, top-right, right, bottom-right, bottom, bottom-left, left, top-left
metadata value 1: 11
metadata value 2: 0
metadata value 3: 0
--------- Level 1 --------
UID             : 2071
ICN object type : 11 (OBJNARTI.ICN)
image index     : 105
layer type      : 0 - Object layer
is shadow       : no
--- Extra information ---
*************************