mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
Merge remote-tracking branch 'origin/beta' into random_prison_distributor
This commit is contained in:
@ -480,14 +480,26 @@ const std::vector<HeroTypeID> CMapGenerator::getAllPossibleHeroes() const
|
||||
for (HeroTypeID hero : map->getMap(this).allowedHeroes)
|
||||
{
|
||||
auto * h = dynamic_cast<const CHero*>(VLC->heroTypes()->getById(hero));
|
||||
if ((h->onlyOnWaterMap && !isWaterMap) || (h->onlyOnMapWithoutWater && isWaterMap))
|
||||
{
|
||||
if(h->onlyOnWaterMap && !isWaterMap)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
||||
if(h->onlyOnMapWithoutWater && isWaterMap)
|
||||
continue;
|
||||
|
||||
bool heroUsedAsStarting = false;
|
||||
for (auto const & player : map->getMapGenOptions().getPlayersSettings())
|
||||
{
|
||||
ret.push_back(hero);
|
||||
if (player.second.getStartingHero() == hero)
|
||||
{
|
||||
heroUsedAsStarting = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (heroUsedAsStarting)
|
||||
continue;
|
||||
|
||||
ret.push_back(hero);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user