1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00

Fix hero kill mission not registered if target hero was the attacker

This commit is contained in:
Ivan Savenko 2024-05-28 15:43:06 +00:00
parent 985adbe07b
commit a8b07477b4

View File

@ -481,12 +481,12 @@ void BattleResultProcessor::endBattleConfirm(const CBattleInfoCallback & battle)
if(finishingBattle->loserHero) //remove beaten hero
{
RemoveObject ro(finishingBattle->loserHero->id, battle.battleGetArmyObject(0)->getOwner());
RemoveObject ro(finishingBattle->loserHero->id, finishingBattle->victor);
gameHandler->sendAndApply(&ro);
}
if(finishingBattle->isDraw() && finishingBattle->winnerHero) //for draw case both heroes should be removed
{
RemoveObject ro(finishingBattle->winnerHero->id, battle.battleGetArmyObject(0)->getOwner());
RemoveObject ro(finishingBattle->winnerHero->id, finishingBattle->loser);
gameHandler->sendAndApply(&ro);
}