mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Bug fixes
Fixed bug in airport ID. Fixed bug in equation of waypoint distance calculation.
This commit is contained in:
parent
6fc9baee07
commit
8c5eb5fb0d
@ -1260,7 +1260,7 @@ function RAT:_SetRoute(takeoff, _departure, _destination)
|
|||||||
local d_holding=Pholding:Get2DDistance(Pdestination)
|
local d_holding=Pholding:Get2DDistance(Pdestination)
|
||||||
|
|
||||||
-- Height difference between departure and holding point.
|
-- Height difference between departure and holding point.
|
||||||
local deltaH=h_holding+H_holding-H_departure
|
local deltaH=math.abs(h_holding+H_holding-H_departure)
|
||||||
|
|
||||||
-- GENERAL
|
-- GENERAL
|
||||||
-- Heading from departure to holding point of destination.
|
-- Heading from departure to holding point of destination.
|
||||||
@ -2239,17 +2239,22 @@ function RAT:_Waypoint(Type, Coord, Speed, Altitude, Airport)
|
|||||||
-- waypoint name (only for the mission editor)
|
-- waypoint name (only for the mission editor)
|
||||||
RoutePoint.name="RAT waypoint"
|
RoutePoint.name="RAT waypoint"
|
||||||
|
|
||||||
if Airport and not Type==RAT.wp.air then
|
if (Airport~=nil) and Type~=RAT.wp.air then
|
||||||
local AirbaseID = Airport:GetID()
|
local AirbaseID = Airport:GetID()
|
||||||
local AirbaseCategory = Airport:GetDesc().category
|
local AirbaseCategory = Airport:GetDesc().category
|
||||||
if AirbaseCategory == Airbase.Category.SHIP then
|
if AirbaseCategory == Airbase.Category.SHIP then
|
||||||
RoutePoint.linkUnit = AirbaseID
|
RoutePoint.linkUnit = AirbaseID
|
||||||
RoutePoint.helipadId = AirbaseID
|
RoutePoint.helipadId = AirbaseID
|
||||||
|
env.info(RAT.id.."WP: Ship id = "..AirbaseID)
|
||||||
elseif AirbaseCategory == Airbase.Category.HELIPAD then
|
elseif AirbaseCategory == Airbase.Category.HELIPAD then
|
||||||
RoutePoint.linkUnit = AirbaseID
|
RoutePoint.linkUnit = AirbaseID
|
||||||
RoutePoint.helipadId = AirbaseID
|
RoutePoint.helipadId = AirbaseID
|
||||||
|
env.info(RAT.id.."WP: Helipad id = "..AirbaseID)
|
||||||
elseif AirbaseCategory == Airbase.Category.AIRDROME then
|
elseif AirbaseCategory == Airbase.Category.AIRDROME then
|
||||||
RoutePoint.airdromeId = AirbaseID
|
RoutePoint.airdromeId = AirbaseID
|
||||||
|
env.info(RAT.id.."WP: Airdrome id = "..AirbaseID)
|
||||||
|
else
|
||||||
|
env.error(RAT.id.."Unknown Airport categoryin _Waypoint()!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- if _AID then
|
-- if _AID then
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170909_1801' )
|
env.info( 'Moose Generation Timestamp: 20170915_1652' )
|
||||||
|
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user