From d5d6c8bae855a84c74916375418c836b5769ad7a Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Tue, 6 Oct 2015 11:46:43 +0300 Subject: [PATCH] Fix of the wrong distance on cross mwm route planning. --- routing/routing_session.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/routing/routing_session.cpp b/routing/routing_session.cpp index c1fb2827b8..74a36950b6 100644 --- a/routing/routing_session.cpp +++ b/routing/routing_session.cpp @@ -85,7 +85,13 @@ void RoutingSession::DoReadyCallback::operator()(Route & route, IRouter::ResultC threads::MutexGuard guard(m_routeSessionMutexInner); UNUSED_VALUE(guard); - m_rs.AssignRoute(route, e); + if (e != IRouter::NeedMoreMaps) + m_rs.AssignRoute(route, e); + else + { + for (string const & country: route.GetAbsentCountries()) + m_rs.m_route.AddAbsentCountry(country); + } m_callback(m_rs.m_route, e); } @@ -127,15 +133,8 @@ RoutingSession::State RoutingSession::OnLocationPositionChanged(m2::PointD const ASSERT(m_state != RoutingNotActive, ()); ASSERT(m_router != nullptr, ()); - if (m_state == RouteNotReady) - { - if (++m_moveAwayCounter > kOnRouteMissedCount) - return RouteNeedRebuild; - else - return RouteNotReady; - } - - if (m_state == RouteNeedRebuild || m_state == RouteFinished || m_state == RouteBuilding) + if (m_state == RouteNeedRebuild || m_state == RouteFinished || m_state == RouteBuilding || + m_state == RouteNotReady) return m_state; threads::MutexGuard guard(m_routeSessionMutex);