mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Spawn quest arts in nearby zones.
This commit is contained in:
@@ -241,6 +241,7 @@ void CMapGenerator::fillZones()
|
||||
it.second->initFreeTiles(this);
|
||||
}
|
||||
|
||||
findZonesForQuestArts();
|
||||
createConnections();
|
||||
//make sure all connections are passable before creating borders
|
||||
for (auto it : zones)
|
||||
@@ -270,6 +271,26 @@ void CMapGenerator::fillZones()
|
||||
logGlobal->infoStream() << "Zones filled successfully";
|
||||
}
|
||||
|
||||
void CMapGenerator::findZonesForQuestArts()
|
||||
{
|
||||
//we want to place arties in zones that were not yet filled (higher index)
|
||||
|
||||
for (auto connection : mapGenOptions->getMapTemplate()->getConnections())
|
||||
{
|
||||
auto zoneA = connection.getZoneA();
|
||||
auto zoneB = connection.getZoneB();
|
||||
|
||||
if (zoneA->getId() > zoneB->getId())
|
||||
{
|
||||
zoneB->setQuestArtZone(zoneA);
|
||||
}
|
||||
else if (zoneA->getId() < zoneB->getId())
|
||||
{
|
||||
zoneA->setQuestArtZone(zoneB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMapGenerator::createConnections()
|
||||
{
|
||||
for (auto connection : mapGenOptions->getMapTemplate()->getConnections())
|
||||
|
Reference in New Issue
Block a user