From d0421f5226f5f61ae7977d3c734f66d19fef8453 Mon Sep 17 00:00:00 2001 From: ttrebuchon Date: Thu, 31 Aug 2023 08:48:08 -0400 Subject: [PATCH] Ensure Altitude is not nil in NewCAP to avoid breaking KnotsToAltKIAS. --- Moose Development/Moose/Ops/Auftrag.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 1bf4f8710..46b957dd7 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -1312,8 +1312,11 @@ function AUFTRAG:NewCAP(ZoneCAP, Altitude, Speed, Coordinate, Heading, Leg, Targ -- Ensure given TargetTypes parameter is a table. TargetTypes=UTILS.EnsureTable(TargetTypes, true) + -- Set default altitude if not specified. + Altitude = Altitude or 10000 + -- Create ORBIT first. - local mission=AUFTRAG:NewORBIT(Coordinate or ZoneCAP:GetCoordinate(), Altitude or 10000, Speed or 350, Heading, Leg) + local mission=AUFTRAG:NewORBIT(Coordinate or ZoneCAP:GetCoordinate(), Altitude, Speed or 350, Heading, Leg) -- Mission type CAP. mission.type=AUFTRAG.Type.CAP