lead->set_temporary(true);
}
- bool target_reached = false;
- for(TrackIter i=train.get_block_allocator().first().track_iter(); i; i=i.next())
+ bool target_tracks = 0;
+ for(TrackIter i=train.get_block_allocator().first().track_iter(); (target_tracks<2 && i); i=i.next())
{
if(i->get_block().get_train()!=&train)
break;
if(target)
{
if(target->has_track(*i))
- target_reached = true;
- else if(target_reached)
+ ++target_tracks;
+ else if(target_tracks>0)
break;
}
lead->add_track(*i);