1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +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

@ -2711,6 +2711,12 @@ std::set<HeroTypeID> CGameState::getUnusedAllowedHeroes(bool alsoIncludeNotAllow
for(int i = 0; i < map->allowedHeroes.size(); i++)
if(map->allowedHeroes[i] || alsoIncludeNotAllowed)
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
{