From a8b07477b4e7d6afaaf91a2cc3b2ae5a0aebfd59 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 28 May 2024 15:43:06 +0000 Subject: [PATCH] Fix hero kill mission not registered if target hero was the attacker --- server/battles/BattleResultProcessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/battles/BattleResultProcessor.cpp b/server/battles/BattleResultProcessor.cpp index 11d4a479d..dbea3fd33 100644 --- a/server/battles/BattleResultProcessor.cpp +++ b/server/battles/BattleResultProcessor.cpp @@ -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); }