mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fix duplicated offroad connections
This commit is contained in:
@@ -143,7 +143,7 @@ void ConnectionsPlacer::forcePortalConnection(const rmg::ZoneConnection & connec
|
|||||||
void ConnectionsPlacer::selfSideDirectConnection(const rmg::ZoneConnection & connection)
|
void ConnectionsPlacer::selfSideDirectConnection(const rmg::ZoneConnection & connection)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
auto otherZoneId = (connection.getZoneA() == zone.getId() ? connection.getZoneB() : connection.getZoneA());
|
auto otherZoneId = connection.getOtherZoneId(zone.getId());
|
||||||
auto & otherZone = map.getZones().at(otherZoneId);
|
auto & otherZone = map.getZones().at(otherZoneId);
|
||||||
bool createRoad = shouldGenerateRoad(connection);
|
bool createRoad = shouldGenerateRoad(connection);
|
||||||
|
|
||||||
@@ -327,10 +327,9 @@ void ConnectionsPlacer::selfSideDirectConnection(const rmg::ZoneConnection & con
|
|||||||
|
|
||||||
assert(otherZone->getModificator<RoadPlacer>());
|
assert(otherZone->getModificator<RoadPlacer>());
|
||||||
otherZone->getModificator<RoadPlacer>()->addRoadNode(roadNode);
|
otherZone->getModificator<RoadPlacer>()->addRoadNode(roadNode);
|
||||||
|
}
|
||||||
assert(otherZone->getModificator<ConnectionsPlacer>());
|
assert(otherZone->getModificator<ConnectionsPlacer>());
|
||||||
otherZone->getModificator<ConnectionsPlacer>()->otherSideConnection(connection);
|
otherZone->getModificator<ConnectionsPlacer>()->otherSideConnection(connection);
|
||||||
}
|
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user