Explorar o código

- Fix to previous commit (keep heroes which are in heroes pool too)

beegee1 %!s(int64=11) %!d(string=hai) anos
pai
achega
674c8bc591
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      server/CGameHandler.cpp

+ 9 - 0
server/CGameHandler.cpp

@@ -5160,6 +5160,15 @@ void CGameHandler::checkVictoryLossConditionsForPlayer(PlayerColor player)
 							crossoverHeroes.push_back(hero);
 						}
 					}
+					// keep lost heroes which are in heroes pool
+					for(auto & heroPair : gs->hpool.heroesPool)
+					{
+						if(vstd::contains(gs->scenarioOps->campState->getCurrentScenario().keepHeroes, HeroTypeID(heroPair.first)))
+						{
+							crossoverHeroes.push_back(heroPair.second.get());
+						}
+					}
+
 					gs->scenarioOps->campState->setCurrentMapAsConquered(crossoverHeroes);
 
 					//Request clients to change connection mode