From 69eb920173a0a4b073eca2f4d0fb003e9359aa8d Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 5 May 2022 17:40:00 +0200 Subject: [PATCH] AI_CAP - more fallout from the dead units in the API --- Moose Development/Moose/AI/AI_CAP.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Moose Development/Moose/AI/AI_CAP.lua b/Moose Development/Moose/AI/AI_CAP.lua index 6653387cc..fa37513c2 100644 --- a/Moose Development/Moose/AI/AI_CAP.lua +++ b/Moose Development/Moose/AI/AI_CAP.lua @@ -428,6 +428,10 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To ) --- Calculate the current route point. local CurrentVec2 = self.Controllable:GetVec2() + if not CurrentVec2 then -- flight dead at this point + return self + end + --DONE: Create GetAltitude function for GROUP, and delete GetUnit(1). local CurrentAltitude = self.Controllable:GetAltitude() local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )