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:
committed by
Alexander Shishkin
parent
fd2a33bc36
commit
4a21841ce2
@ -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)
|
||||||
|
Reference in New Issue
Block a user