mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Allow all terrains from mods by default (including Wasteland).
This commit is contained in:
@@ -73,13 +73,22 @@ void TerrainPainter::initTerrainType()
|
||||
auto terrainTypes = zone.getTerrainTypes();
|
||||
if (terrainTypes.empty())
|
||||
{
|
||||
logGlobal->warn("No terrain types found, falling back to DIRT");
|
||||
zone.setTerrainType(ETerrainId::DIRT);
|
||||
}
|
||||
else
|
||||
{
|
||||
zone.setTerrainType(*RandomGeneratorUtil::nextItem(terrainTypes, zone.getRand()));
|
||||
//Fill with all terain types by default
|
||||
{
|
||||
for (auto terrain : VLC->terrainTypeHandler->objects)
|
||||
{
|
||||
if (terrain->isLand() && terrain->isPassable())
|
||||
{
|
||||
if (terrain->isSurface() && !zone.isUnderground() ||
|
||||
terrain->isUnderground() && zone.isUnderground())
|
||||
{
|
||||
terrainTypes.insert(terrain->getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
zone.setTerrainType(*RandomGeneratorUtil::nextItem(terrainTypes, zone.getRand()));
|
||||
}
|
||||
|
||||
//Now, replace disallowed terrains on surface and in the underground
|
||||
|
||||
Reference in New Issue
Block a user