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

Fix duplicated offroad connections

This commit is contained in:
Tomasz Zieliński 2024-11-23 10:43:14 +01:00
parent c8e3458dfb
commit e5b151991b

View File

@ -143,7 +143,7 @@ void ConnectionsPlacer::forcePortalConnection(const rmg::ZoneConnection & connec
void ConnectionsPlacer::selfSideDirectConnection(const rmg::ZoneConnection & connection)
{
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);
bool createRoad = shouldGenerateRoad(connection);
@ -327,10 +327,9 @@ void ConnectionsPlacer::selfSideDirectConnection(const rmg::ZoneConnection & con
assert(otherZone->getModificator<RoadPlacer>());
otherZone->getModificator<RoadPlacer>()->addRoadNode(roadNode);
}
assert(otherZone->getModificator<ConnectionsPlacer>());
otherZone->getModificator<ConnectionsPlacer>()->otherSideConnection(connection);
}
success = true;
}