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.58k stars 360 forks source link

Prevent a crash when a hero is killed defending a castle #8811

Closed Canop closed 3 weeks ago

Canop commented 3 weeks ago

Fix #8809

I think both the task and the list of enemy armies should be updated.

I'm not totally confident this is the right place for _enemyArmies (i.e. this might hide a problem elsewhere).

oleg-derevenetz commented 3 weeks ago

Hi @Canop @ihhub I believe that the proper fix should look like this (please see my latest changes in this PR).

ihhub commented 3 weeks ago

@Canop , thank you very much for your contribution to the project!