This enforces common traversal rules in all places. It also fixes a bug
in TrackOffsetIter where moving to a turnout from an endpoint not on the
selected path would potentially cause an out-of-range iterator to be
created.
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
{
if(p<0)
p = (r ? r->get_path(*t) : t->get_active_path());
+ p = t->get_type().coerce_path(t.entry(), p);
float length = t->get_type().get_path_length(p);
if(o<length)