[routing] Route calculation on world graph in case of start and finish leaps.

This commit is contained in:
Vladimir Byko-Ianko 2017-05-12 16:32:22 +03:00 committed by r.kuznetsov
parent 15d3d351a2
commit 7976081f0d

View file

@ -316,6 +316,13 @@ IRouter::ResultCode IndexRouter::ProcessLeaps(vector<Segment> const & input,
continue;
}
// In case of leaps from the start to its mwm transition and from finish mwm transition
// Route calculation should be made on the world graph (WorldGraph::Mode::NoLeaps).
if ((i == 0 || i + 2 == input.size()) && worldRouteMode == WorldGraph::Mode::LeapsOnly)
worldGraph.SetMode(WorldGraph::Mode::NoLeaps);
else
worldGraph.SetMode(WorldGraph::Mode::SingleMwm);
++i;
CHECK_LESS(i, input.size(), ());
Segment const & next = input[i];