1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Clear unused tiles to make more space for roads.

This commit is contained in:
DjWarmonger 2015-06-03 15:16:11 +02:00
parent 48efa2450a
commit 55c1a7eade
2 changed files with 9 additions and 0 deletions

View File

@ -557,6 +557,7 @@ void CMapGenerator::createConnections()
zoneA->placeAndGuardObject(this, gate1, tile, connection.getGuardStrength());
auto gate2 = new CGSubterraneanGate(*gate1);
zoneB->placeAndGuardObject(this, gate2, otherTile, connection.getGuardStrength());
//TODO: connect gates with middle of zone / free paths. At this point free paths do not exist yet.
stop = true; //we are done, go to next connection
}

View File

@ -1662,6 +1662,14 @@ void CRmgTemplateZone::createObstacles2(CMapGenerator* gen)
}
}
}
//cleanup - remove unused possible tiles to make space for roads
for (auto tile : tileinfo)
{
if (gen->isPossible(tile))
{
gen->setOccupied (tile, ETileType::FREE);
}
}
}
void CRmgTemplateZone::connectRoads(CMapGenerator* gen)