Merge pull request #2001 from ttrebuchon/tt/auftrag-newcap-nil-ref-bugfix

Fix error in AUFTRAG:NewCAP when Altitude is not explicitly provided
This commit is contained in:
Frank 2023-08-31 14:57:31 +02:00 committed by GitHub
commit b5b079d75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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