diff --git a/routing/index_router.cpp b/routing/index_router.cpp index 8417b92398..a36ee2059a 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -305,7 +305,6 @@ IRouter::ResultCode IndexRouter::ProcessLeaps(vector const & input, WorldGraph & worldGraph = starter.GetGraph(); WorldGraph::Mode const worldRouteMode = worldGraph.GetMode(); - worldGraph.SetMode(WorldGraph::Mode::SingleMwm); for (size_t i = 0; i < input.size(); ++i) { @@ -318,6 +317,19 @@ IRouter::ResultCode IndexRouter::ProcessLeaps(vector 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 ((current.GetMwmId() == starter.GetStartVertex().GetMwmId() + || current.GetMwmId() == starter.GetFinishVertex().GetMwmId()) + && 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];