From 37671cefa3cb3400b3be7ea0ef753b793fa44cdb Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 24 Apr 2022 13:50:23 +0200 Subject: [PATCH] GROUP - overwrite GetHeight() inherited from POSITIONABLE with something that is actually working for groups --- Moose Development/Moose/Wrapper/Group.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 822b98696..ce8bf3dee 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -796,11 +796,19 @@ function GROUP:GetVelocityVec3() return nil end +--- Returns the average group altitude in meters. +-- @param Wrapper.Group#GROUP self +-- @param #boolean FromGround Measure from the ground or from sea level (ASL). Provide **true** for measuring from the ground (AGL). **false** or **nil** if you measure from sea level. +-- @return #number The altitude of the group or nil if is not existing or alive. +function GROUP:GetAltitude(FromGround) + self:F2( self.GroupName ) + return self:GetHeight(FromGround) +end --- Returns the average group height in meters. -- @param Wrapper.Group#GROUP self --- @param #boolean FromGround Measure from the ground or from sea level. Provide **true** for measuring from the ground. **false** or **nil** if you measure from sea level. --- @return DCS#Vec3 The height of the group or nil if is not existing or alive. +-- @param #boolean FromGround Measure from the ground or from sea level (ASL). Provide **true** for measuring from the ground (AGL). **false** or **nil** if you measure from sea level. +-- @return #number The height of the group or nil if is not existing or alive. function GROUP:GetHeight( FromGround ) self:F2( self.GroupName )