1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Ground connections between adjacent zones.

This commit is contained in:
DjWarmonger
2014-05-31 10:56:14 +02:00
parent 8ab2a8df86
commit 8e8b27087a
5 changed files with 152 additions and 20 deletions

View File

@ -207,14 +207,6 @@ void CMapGenerator::genZones()
for(auto const it : zones)
{
CRmgTemplateZone * zone = it.second;
std::vector<int3> shape;
int left = part_w*(i%player_per_side);
int top = part_h*(i/player_per_side);
shape.push_back(int3(left, top, 0));
shape.push_back(int3(left + part_w, top, 0));
shape.push_back(int3(left + part_w, top + part_h, 0));
shape.push_back(int3(left, top + part_h, 0));
zone->setShape(shape);
zone->setType(i < pcnt ? ETemplateZoneType::PLAYER_START : ETemplateZoneType::TREASURE);
this->zones[it.first] = zone;
++i;
@ -225,8 +217,14 @@ void CMapGenerator::genZones()
void CMapGenerator::fillZones()
{
logGlobal->infoStream() << "Started filling zones";
for(auto it : zones)
for (auto it : zones)
{
it.second->createConnections(this);
}
for (auto it : zones)
{
//make sure all connections are passable before creating borders
it.second->createBorder(this);
it.second->fill(this);
}