From 065c59f167dab88b07d74718aef53523e0c828c1 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 2 Jun 2023 08:44:43 +0200 Subject: [PATCH] #UNIT #CTLD * Stabilize that sometimes a unit coordinate cannot be found --- Moose Development/Moose/Modules_local.lua | 1 + Moose Development/Moose/Ops/CTLD.lua | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Modules_local.lua b/Moose Development/Moose/Modules_local.lua index c638e81db..a16bfc378 100644 --- a/Moose Development/Moose/Modules_local.lua +++ b/Moose Development/Moose/Modules_local.lua @@ -21,6 +21,7 @@ __Moose.Include( 'Core\\Zone_Detection.lua' ) __Moose.Include( 'Core\\Database.lua' ) __Moose.Include( 'Core\\Set.lua' ) __Moose.Include( 'Core\\Point.lua' ) +__Moose.Include( 'Core\\Pathline.lua' ) __Moose.Include( 'Core\\Velocity.lua' ) __Moose.Include( 'Core\\Message.lua' ) __Moose.Include( 'Core\\Fsm.lua' ) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 04e84ee7d..0edb51e80 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -22,7 +22,7 @@ -- @module Ops.CTLD -- @image OPS_CTLD.jpg --- Last Update Apr 2023 +-- Last Update June 2023 do @@ -1221,7 +1221,7 @@ CTLD.UnitTypes = { --- CTLD class version. -- @field #string version -CTLD.version="1.0.37" +CTLD.version="1.0.38" --- Instantiate a new CTLD. -- @param #CTLD self @@ -4308,6 +4308,9 @@ end local uspeed = Unit:GetVelocityMPS() local uheight = Unit:GetHeight() local ucoord = Unit:GetCoordinate() + if not ucoord then + return false + end local gheight = ucoord:GetLandHeight() local aheight = uheight - gheight -- height above ground local maxh = self.maximumHoverHeight -- 15 @@ -4334,6 +4337,9 @@ end local uspeed = Unit:GetVelocityMPS() local uheight = Unit:GetHeight() local ucoord = Unit:GetCoordinate() + if not ucoord then + return false + end local gheight = ucoord:GetLandHeight() local aheight = uheight - gheight -- height above ground local minh = self.HercMinAngels-- 1500m @@ -4419,6 +4425,9 @@ end end local uheight = Unit:GetHeight() local ucoord = Unit:GetCoordinate() + if not ucoord then + return false + end local gheight = ucoord:GetLandHeight() local aheight = uheight - gheight -- height above ground if aheight >= minheight then