mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Added encapsulation for CampaignState class
This commit is contained in:
@@ -1076,21 +1076,7 @@ void PlayerEndsGame::applyGs(CGameState * gs) const
|
||||
// keep all heroes from the winning player
|
||||
crossoverHeroes.push_back(hero);
|
||||
}
|
||||
else if (vstd::contains(gs->scenarioOps->campState->getCurrentScenario().keepHeroes, HeroTypeID(hero->subID)))
|
||||
{
|
||||
// keep hero whether lost or won (like Xeron in AB campaign)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user