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.74k stars 377 forks source link

Adventure map, "Find the Ultimate Artifact" victory condition not respected #4393

Open LeHerosInconnu opened 3 years ago

LeHerosInconnu commented 3 years ago

Preliminary checks

Platform

Windows

Describe the bug

While running a scenario designed for testing on passibility, I came across this bug. This scenario has to find the Ultimate Artifact as a victory condition, there is only one player. One of the heroes of this scenario, has three copies of the same Ultimate Artifact at the beginning of the scenario, placed in his inventory with the scenario editor.

In the scenario editor:

Find UA not respected 001

Find UA not respected 002

By launching this scenario with fheroes2, the victory screen is displayed directly (0 9953.MX2). We can notice also, some display defects when it happens, a brown square at the bottom, and a chess piece in its frame used for the scenario difficulty behind the message window. This scenario works correctly in the original game (edit: there is also a bug in this case in the original game).

In fheroes2:

Find UA not respected 003

If the three copies of the same Ultimate Artifact are removed with the scenario editor, the victory screen does not appear anymore in fheroes2 (0 9953a.MX2).

If an Ultimate Artifact is given by an event on the adventure map, it results in the victory of the scenario as soon as the player ends the turn, this should not be the case either (0 9953b.MX2). (There is also a bug in this case in the original game.)

Location of the map event: Find UA not respected 004

The victory condition should only be validated if one of the player's heroes digs and actually discovers the Ultimate Artifact, and if an opposing hero digs and discovers the Ultimate Artifact, the scenario should be immediately lost.

Save file

Here are the scenario test files: Find UA not respected 01.zip

Additional info

Version 0.9.8 4311

ihhub commented 3 years ago

UI portion of this issue is fixed.