for(vector<TrainRoutingInfo>::iterator i=routed_trains.begin(); i!=routed_trains.end(); ++i)
{
for(list<Route *>::iterator j=i->routes.begin(); j!=i->routes.end(); ++j)
- i->router->add_route(**j);
+ {
+ if(j==i->routes.begin())
+ i->router->set_route(*j);
+ else
+ i->router->add_route(**j);
+ }
+
const TrainRoutingState *current_wait = 0;
for(list<const TrainRoutingState *>::const_iterator j=i->waits.begin(); j!=i->waits.end(); ++j)
if(!current_wait || (*j)->track.track()!=current_wait->track.track())