1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Check other players startinfo for random hero pick (#580)

This commit is contained in:
Dydzio
2019-04-29 07:45:30 +02:00
committed by Alexander Shishkin
parent fd2a33bc36
commit 4a21841ce2

View File

@ -2712,6 +2712,12 @@ std::set<HeroTypeID> CGameState::getUnusedAllowedHeroes(bool alsoIncludeNotAllow
if(map->allowedHeroes[i] || alsoIncludeNotAllowed) if(map->allowedHeroes[i] || alsoIncludeNotAllowed)
ret.insert(HeroTypeID(i)); ret.insert(HeroTypeID(i));
for(auto & playerSettingPair : scenarioOps->playerInfos) //remove uninitialized yet heroes picked for start by other players
{
if(playerSettingPair.second.hero != PlayerSettings::RANDOM)
ret -= HeroTypeID(playerSettingPair.second.hero);
}
for(auto hero : map->heroesOnMap) //heroes instances initialization for(auto hero : map->heroesOnMap) //heroes instances initialization
{ {
if(hero->type) if(hero->type)