Skip to content

Commit

Permalink
fixing the case were the network was computed before joining. refs #1…
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 30, 2024
1 parent 1720f32 commit bd03dc7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/netedit/elements/network/GNEJunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,12 @@ GNEJunction::invalidateTLS(GNEUndoList* undoList, const NBConnection& deletedCon
const std::vector<NBNode*> copyOfNodes = tlDef->getNodes(); // make a copy!
for (const auto& node : copyOfNodes) {
GNEJunction* sharing = myNet->getAttributeCarriers()->retrieveJunction(node->getID());
// recompute crossing indices for shared
// (they won't do this on subsequent call to invalidateTLS if they received an NBOwnTLDef)
for (const auto& crossing : sharing->getGNECrossings()) {
GNEChange_Attribute::changeAttribute(crossing, SUMO_ATTR_TLLINKINDEX, toString(NBConnection::InvalidTlIndex), undoList, true);
GNEChange_Attribute::changeAttribute(crossing, SUMO_ATTR_TLLINKINDEX2, toString(NBConnection::InvalidTlIndex), undoList, true);
}
undoList->add(new GNEChange_TLS(sharing, tlDef, false), true);
undoList->add(new GNEChange_TLS(sharing, replacementDef, true, false, newID), true);
}
Expand Down

0 comments on commit bd03dc7

Please sign in to comment.