if(!_block->has_track(*t_iter))
throw LogicError("Block traversal strayed out of the block");
- int path = -1;
- if(t_iter->get_turnout_id() && route)
- path = route->get_turnout(t_iter->get_turnout_id());
- if(path==-1)
- path = t_iter->get_active_path();
-
+ unsigned path = (route ? route->get_path(*t_iter) : t_iter->get_active_path());
TrackIter t_exit = t_iter.reverse(path);
for(unsigned i=0; i<eps.size(); ++i)
if(eps[i].track==t_exit.track() && eps[i].track_ep==t_exit.entry())
return i;
- t_iter = t_iter.next(path);
+ t_iter = t_exit.flip();
}
return -1;