Skip to content

Commit

Permalink
fix #3813
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Feb 14, 2018
1 parent 727cbb2 commit d1c1ff1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/netbuild/NBLoadedSUMOTLDef.cpp
Expand Up @@ -490,12 +490,21 @@ NBLoadedSUMOTLDef::reconstructLogic() {
}
}
if (exclusive) {
// shift indices above the removed index downward
for (NBConnectionVector::iterator j = myControlledLinks.begin(); j != myControlledLinks.end(); j++) {
NBConnection& other = *j;
if (other.getTLIndex() > removed) {
other.setTLIndex(other.getTLIndex() - 1);
}
}
// shift crossing custom indices above the removed index downward
for (NBNode* n : myControlledNodes) {
for (NBNode::Crossing* c : n->getCrossings()) {
if (c->customTLIndex > removed) {
c->customTLIndex--;
}
}
}
// rebuild the logic
const std::vector<NBTrafficLightLogic::PhaseDefinition> phases = myTLLogic->getPhases();
NBTrafficLightLogic* newLogic = new NBTrafficLightLogic(getID(), getProgramID(), 0, myOffset, myType);
Expand Down

0 comments on commit d1c1ff1

Please sign in to comment.