|
@@ -497,18 +497,6 @@ void BattleResultProcessor::battleFinalize(const BattleID & battleID, const Batt
|
|
|
//handle victory/loss of engaged players
|
|
|
gameHandler->checkVictoryLossConditions({finishingBattle->loser, finishingBattle->victor});
|
|
|
|
|
|
- if (result.result == EBattleResult::SURRENDER)
|
|
|
- {
|
|
|
- gameHandler->gameState().statistic.accumulatedValues[finishingBattle->loser].numHeroSurrendered++;
|
|
|
- gameHandler->heroPool->onHeroSurrendered(finishingBattle->loser, loserHero);
|
|
|
- }
|
|
|
-
|
|
|
- if (result.result == EBattleResult::ESCAPE)
|
|
|
- {
|
|
|
- gameHandler->gameState().statistic.accumulatedValues[finishingBattle->loser].numHeroEscaped++;
|
|
|
- gameHandler->heroPool->onHeroEscaped(finishingBattle->loser, loserHero);
|
|
|
- }
|
|
|
-
|
|
|
// Remove beaten hero
|
|
|
if(loserHero)
|
|
|
{
|
|
@@ -524,6 +512,18 @@ void BattleResultProcessor::battleFinalize(const BattleID & battleID, const Batt
|
|
|
gameHandler->heroPool->onHeroEscaped(finishingBattle->victor, winnerHero);
|
|
|
}
|
|
|
|
|
|
+ if (result.result == EBattleResult::SURRENDER)
|
|
|
+ {
|
|
|
+ gameHandler->gameState().statistic.accumulatedValues[finishingBattle->loser].numHeroSurrendered++;
|
|
|
+ gameHandler->heroPool->onHeroSurrendered(finishingBattle->loser, loserHero);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (result.result == EBattleResult::ESCAPE)
|
|
|
+ {
|
|
|
+ gameHandler->gameState().statistic.accumulatedValues[finishingBattle->loser].numHeroEscaped++;
|
|
|
+ gameHandler->heroPool->onHeroEscaped(finishingBattle->loser, loserHero);
|
|
|
+ }
|
|
|
+
|
|
|
finishingBattles.erase(battleID);
|
|
|
battleResults.erase(battleID);
|
|
|
}
|