mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Do not allow heroes banned for player as starting heroes
- `disposedHeroes` is now in map header, for use in map selection - heroes that are marked as unavailable for player will now be hidden from starting hero selection
This commit is contained in:
@@ -640,19 +640,19 @@ void CMapFormatJson::readDisposedHeroes(JsonSerializeFormat & handler)
|
||||
hero.players = mask;
|
||||
//name and portrait are not used
|
||||
|
||||
map->disposedHeroes.push_back(hero);
|
||||
mapHeader->disposedHeroes.push_back(hero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMapFormatJson::writeDisposedHeroes(JsonSerializeFormat & handler)
|
||||
{
|
||||
if(map->disposedHeroes.empty())
|
||||
if(mapHeader->disposedHeroes.empty())
|
||||
return;
|
||||
|
||||
auto definitions = handler.enterStruct("predefinedHeroes");//DisposedHeroes are part of predefinedHeroes in VCMI map format
|
||||
|
||||
for(DisposedHero & hero : map->disposedHeroes)
|
||||
for(DisposedHero & hero : mapHeader->disposedHeroes)
|
||||
{
|
||||
std::string type = HeroTypeID::encode(hero.heroId.getNum());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user