mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Added last waypoint to RouteGroundOnRoad function if that is not on road.
This commit is contained in:
parent
f69f666deb
commit
6f6db6d26f
@ -1953,6 +1953,12 @@ function CONTROLLABLE:RouteGroundOnRoad( ToCoordinate, Speed, DelaySeconds )
|
||||
table.insert(route, coord:WaypointGround(Speed, Formation))
|
||||
end
|
||||
|
||||
-- Add the final coordinate because the final coordinate in path is last point on road.
|
||||
local dist=ToCoordinate:Get2DDistance(path[#path])
|
||||
if dist>10 then
|
||||
table.insert(route, ToCoordinate:WaypointGround(Speed, "Vee"))
|
||||
end
|
||||
|
||||
-- Route controllable to destination.
|
||||
self:Route(route, DelaySeconds)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user