1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Fixed counting of faction-aligned zones.

This commit is contained in:
DjWarmonger
2014-07-23 19:17:07 +02:00
parent 9644314c8a
commit 4b28afcaa4
2 changed files with 9 additions and 1 deletions

View File

@@ -213,6 +213,10 @@ void CMapGenerator::genZones()
void CMapGenerator::fillZones()
{
//init native town count with 0
for (auto faction : VLC->townh->getAllowedFactions())
zonesPerFaction[faction] = 0;
logGlobal->infoStream() << "Started filling zones";
createConnections();
@@ -220,6 +224,11 @@ void CMapGenerator::fillZones()
for (auto it : zones)
{
it.second->createBorder(this);
//we need info about all town types to evaluate dwellings and pandoras with creatures properly
it.second->initTownType(this);
}
for (auto it : zones)
{
it.second->fill(this);
}
logGlobal->infoStream() << "Zones filled successfully";

View File

@@ -1166,7 +1166,6 @@ void CRmgTemplateZone::createObstacles(CMapGenerator* gen)
bool CRmgTemplateZone::fill(CMapGenerator* gen)
{
initTownType(gen);
initTerrainType(gen);
freePaths.insert(pos); //zone center should be always clear to allow other tiles to connect