if(!_track->get_type().is_turnout())
{
- TrackIter rev = reverse();
+ /* Since there was no endpoint match, the preceding track can't be in a
+ different block. */
+ TrackIter rev = flip();
TrackIter last;
while(rev && &rev.track()->get_block()==&block)
{
last = rev;
rev = rev.next();
-
- // If we ran out of tracks, return an empty iterator
- if(!rev)
- return BlockIter();
}
+ // If we ran out of tracks, return an empty iterator
+ if(!rev)
+ return BlockIter();
+
TrackIter fwd = last.reverse();
for(unsigned i=0; i<beps.size(); ++i)
if(beps[i].track==fwd.track() && beps[i].track_ep==fwd.entry())
int TrackIter::get_exit(unsigned path) const
{
+ path = _track->get_type().coerce_path(_entry, path);
const vector<TrackType::Endpoint> &eps = _track->get_type().get_endpoints();
// Find an endpoint that's connected to the entry and has the requested path