{
i->routes.clear();
i->sequence.clear();
- for(unsigned j=0; j<3; ++j)
+ for(unsigned j=0; j<2; ++j)
i->track_history[j] = 0;
}
route = new Route(j->info->train->get_layout());
route->set_name("Router");
route->set_temporary(true);
- for(unsigned k=2; k>0; --k)
- if(history[k])
- route->add_track(*history[k]);
+ for(unsigned k=0; (k<2 && history[k]); ++k)
+ route->add_track(*history[k]);
j->info->routes.push_front(route);
}
- if(history[0])
- route->add_track(*history[0]);
- for(unsigned k=2; k>0; --k)
- history[k] = history[k-1];
+ route->add_track(*j->track.track());
+ history[1] = history[0];
history[0] = j->track.track();
bool waitable = j->track.endpoint().paths!=j->track->get_type().get_paths();
float speed;
TrainRouter *router;
std::list<Route *> routes;
- Track *track_history[3];
+ Track *track_history[2];
std::list<TrainRouter::SequencePoint> sequence;
TrainRoutingInfo(Train &);