forked from organicmaps/organicmaps
recostruct path only if router had been succeeded
This commit is contained in:
parent
166941f823
commit
ecd0052b31
1 changed files with 9 additions and 5 deletions
|
@ -90,14 +90,18 @@ IRouter::ResultCode RoadGraphRouter::CalculateRoute(m2::PointD const & startPoin
|
|||
m_roadGraph->AddFakeTurns(finalPos, finalVicinity);
|
||||
|
||||
vector<RoadPos> routePos;
|
||||
IRouter::ResultCode resultCode = CalculateRoute(startPos, finalPos, routePos);
|
||||
|
||||
ASSERT(routePos.back() == finalPos, ());
|
||||
ASSERT(routePos.front() == startPos, ());
|
||||
IRouter::ResultCode const resultCode = CalculateRoute(startPos, finalPos, routePos);
|
||||
|
||||
LOG(LINFO, ("Route calculation time:", timer.ElapsedSeconds(), "result code:", resultCode));
|
||||
|
||||
m_roadGraph->ReconstructPath(routePos, route);
|
||||
if (IRouter::NoError == resultCode)
|
||||
{
|
||||
ASSERT(routePos.back() == finalPos, ());
|
||||
ASSERT(routePos.front() == startPos, ());
|
||||
|
||||
m_roadGraph->ReconstructPath(routePos, route);
|
||||
}
|
||||
|
||||
return resultCode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue