mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Even tighter obstacles.
This commit is contained in:
@@ -1116,6 +1116,12 @@ void CRmgTemplateZone::createTreasures(CMapGenerator* gen)
|
||||
void CRmgTemplateZone::createObstacles(CMapGenerator* gen)
|
||||
{
|
||||
//tighten obstacles to improve visuals
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
int blockedTiles = 0;
|
||||
int freeTiles = 0;
|
||||
|
||||
for (auto tile : tileinfo)
|
||||
{
|
||||
if (!gen->isPossible(tile)) //only possible tiles can change
|
||||
@@ -1131,9 +1137,17 @@ void CRmgTemplateZone::createObstacles(CMapGenerator* gen)
|
||||
freeNeighbours++;
|
||||
});
|
||||
if (blockedNeighbours > 4)
|
||||
{
|
||||
gen->setOccupied(tile, ETileType::BLOCKED);
|
||||
blockedTiles++;
|
||||
}
|
||||
else if (freeNeighbours > 4)
|
||||
{
|
||||
gen->setOccupied(tile, ETileType::FREE);
|
||||
freeTiles++;
|
||||
}
|
||||
}
|
||||
logGlobal->infoStream() << boost::format("Set %d tiles to BLOCKED and %d tiles to FREE") % blockedTiles % freeTiles;
|
||||
}
|
||||
|
||||
if (pos.z) //underground
|
||||
|
Reference in New Issue
Block a user