|
@@ -635,11 +635,9 @@ void CGameHandler::endBattleConfirm(const BattleInfo * battleInfo)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const CArmedInstance *bEndArmy1 = battleInfo->sides.at(0).armyObject;
|
|
|
- const CArmedInstance *bEndArmy2 = battleInfo->sides.at(1).armyObject;
|
|
|
const BattleResult::EResult result = battleResult.get()->result;
|
|
|
|
|
|
- CasualtiesAfterBattle cab1(bEndArmy1, battleInfo), cab2(bEndArmy2, battleInfo); //calculate casualties before deleting battle
|
|
|
+ CasualtiesAfterBattle cab1(battleInfo->sides.at(0), battleInfo), cab2(battleInfo->sides.at(1), battleInfo); //calculate casualties before deleting battle
|
|
|
ChangeSpells cs; //for Eagle Eye
|
|
|
|
|
|
if(!finishingBattle->isDraw() && finishingBattle->winnerHero)
|
|
@@ -816,8 +814,8 @@ void CGameHandler::endBattleConfirm(const BattleInfo * battleInfo)
|
|
|
changePrimSkill(finishingBattle->winnerHero, PrimarySkill::EXPERIENCE, battleResult.data->exp[finishingBattle->winnerSide]);
|
|
|
|
|
|
BattleResultAccepted raccepted;
|
|
|
- raccepted.heroResult[0].army = const_cast<CArmedInstance*>(bEndArmy1);
|
|
|
- raccepted.heroResult[1].army = const_cast<CArmedInstance*>(bEndArmy2);
|
|
|
+ raccepted.heroResult[0].army = const_cast<CArmedInstance*>(battleInfo->sides.at(0).armyObject);
|
|
|
+ raccepted.heroResult[1].army = const_cast<CArmedInstance*>(battleInfo->sides.at(1).armyObject);
|
|
|
raccepted.heroResult[0].hero = const_cast<CGHeroInstance*>(battleInfo->sides.at(0).hero);
|
|
|
raccepted.heroResult[1].hero = const_cast<CGHeroInstance*>(battleInfo->sides.at(1).hero);
|
|
|
raccepted.heroResult[0].exp = battleResult.data->exp[0];
|
|
@@ -6684,14 +6682,12 @@ void CGameHandler::showInfoDialog(const std::string & msg, PlayerColor player)
|
|
|
showInfoDialog(&iw);
|
|
|
}
|
|
|
|
|
|
-CasualtiesAfterBattle::CasualtiesAfterBattle(const CArmedInstance * _army, const BattleInfo * bat):
|
|
|
- army(_army)
|
|
|
+CasualtiesAfterBattle::CasualtiesAfterBattle(const SideInBattle & battleSide, const BattleInfo * bat):
|
|
|
+ army(battleSide.armyObject)
|
|
|
{
|
|
|
heroWithDeadCommander = ObjectInstanceID();
|
|
|
|
|
|
- PlayerColor color = army->tempOwner;
|
|
|
- if(color == PlayerColor::UNFLAGGABLE)
|
|
|
- color = PlayerColor::NEUTRAL;
|
|
|
+ PlayerColor color = battleSide.color;
|
|
|
|
|
|
for(CStack * st : bat->stacks)
|
|
|
{
|