소스 검색

Check for win/loss after removing hero from map

Ivan Savenko 4 달 전
부모
커밋
4044e03c0a
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      server/battles/BattleResultProcessor.cpp

+ 3 - 3
server/battles/BattleResultProcessor.cpp

@@ -546,9 +546,6 @@ void BattleResultProcessor::battleFinalize(const BattleID & battleID, const Batt
 	resultsApplied.loser = finishingBattle->loser;
 	gameHandler->sendAndApply(resultsApplied);
 
-	//handle victory/loss of engaged players
-	gameHandler->checkVictoryLossConditions({finishingBattle->loser, finishingBattle->victor});
-
 	// Remove beaten hero
 	if(loserHero)
 	{
@@ -564,6 +561,9 @@ void BattleResultProcessor::battleFinalize(const BattleID & battleID, const Batt
 			gameHandler->heroPool->onHeroEscaped(finishingBattle->victor, winnerHero);
 	}
 
+	//handle victory/loss of engaged players
+	gameHandler->checkVictoryLossConditions({finishingBattle->loser, finishingBattle->victor});
+
 	if (result.result == EBattleResult::SURRENDER)
 	{
 		gameHandler->statistics->accumulatedValues[finishingBattle->loser].numHeroSurrendered++;