From a9b51cca93cef5355b754c457cdbecf1cd540610 Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 15 Jun 2023 01:24:59 +0200 Subject: [PATCH] Update Auftrag.lua --- Moose Development/Moose/Ops/Auftrag.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index cb1bda5be..3c967a15e 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -5579,7 +5579,13 @@ function AUFTRAG:GetMissionWaypointCoord(group, randomradius, surfacetypes) end -- Create waypoint coordinate half way between us and the target. - local waypointcoord=group:GetCoordinate():GetIntermediateCoordinate(self:GetTargetCoordinate(), self.missionFraction) + local waypointcoord=COORDINATE:New(0,0,0) + local coord=group:GetCoordinate() + if coord then + waypointcoord=coord:GetIntermediateCoordinate(self:GetTargetCoordinate(), self.missionFraction) + else + self:E(self.lid..string.format("ERROR: Cannot get coordinate of group %s (alive=%s)!", tostring(group:GetName()), tostring(group:IsAlive()))) + end local alt=waypointcoord.y -- Add some randomization.