void TrainRoutePlanner::TrainRoutingState::update_estimate()
{
TrackIter iter = track.reverse(path);
- float distance = info->metrics[waypoint]->get_distance_from(*iter.track(), iter.entry());
- distance += track->get_type().get_path_length(path)-offset;
- remaining_estimate = distance;
+ remaining_estimate = info->metrics[waypoint]->get_distance_from(*iter.track(), iter.entry());
+ if(remaining_estimate>=0)
+ remaining_estimate += track->get_type().get_path_length(path)-offset;
}
bool TrainRoutePlanner::TrainRoutingState::is_viable() const