1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Load obstacle sets from json in mods

This commit is contained in:
Tomasz Zieliński
2024-04-05 08:31:05 +02:00
parent b1a5693612
commit 305e2bdf2f
6 changed files with 102 additions and 5 deletions

View File

@@ -177,7 +177,10 @@ bool ObstacleProxy::prepareBiome(TerrainId terrain, CRandomGenerator & rand)
// Copy this set to our possible obstacles
if (selectedSets >= MINIMUM_SETS)
// if (selectedSets >= MINIMUM_SETS)
if (selectedSets >= MINIMUM_SETS ||
(terrain == TerrainId::WATER && selectedSets > 0))
{
obstaclesBySize.clear();
for (const auto & os : obstacleSets)
@@ -200,7 +203,7 @@ bool ObstacleProxy::prepareBiome(TerrainId terrain, CRandomGenerator & rand)
{
return p1.first > p2.first; //bigger obstacles first
});
return true;
}
else