From a126906776f20b8e876c2d42257d39d2ee8e932e Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 29 Aug 2020 21:24:15 +0200 Subject: [PATCH] up --- Moose Development/Moose/Wrapper/Group.lua | 39 ------------------- .../Moose/Wrapper/Positionable.lua | 6 +-- 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 4a6798bbb..7ceb235af 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -2245,45 +2245,6 @@ function GROUP:GetDCSDesc(n) return nil end ---- Get health of the group. --- @param #GROUP self --- @return #number Health in percent. -function GROUP:GetHealth() - - local lp=0 - local lp0=0 - - local units=self:GetUnits() - - for _,_unit in pairs(units or {}) do - local unit=_unit --Wrapper.Unit#UNIT - - if unit and unit:IsAlive() then - local life=unit:GetLife() - local life0=unit:GetLife0() - life0=math.max(life0, life) --Issue with ships - - lp=lp+life - lp0=lp0+life - - end - - end - - if lp0>0 then - return lp/lp0*100 - else - return 0 - end -end - ---- Get damage of the group. --- @param #GROUP self --- @return #number Damage in percent. -function GROUP:GetDamage() - return 100-self:GetHealth() -end - --- Get the generalized attribute of a self. -- Note that for a heterogenious self, the attribute is determined from the attribute of the first unit! diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua index f1a4ba934..5097935bb 100644 --- a/Moose Development/Moose/Wrapper/Positionable.lua +++ b/Moose Development/Moose/Wrapper/Positionable.lua @@ -304,8 +304,7 @@ function POSITIONABLE:GetPointVec3() -- Get 3D vector. local PositionableVec3 = self:GetPositionVec3() - if self.pointvec3 then - --env.info("FF GetCoordinate GOT for "..tostring(self.PositionableName)) + if false and self.pointvec3 then -- Update vector. self.pointvec3.x=PositionableVec3.x @@ -313,9 +312,10 @@ function POSITIONABLE:GetPointVec3() self.pointvec3.z=PositionableVec3.z else - --env.info("FF GetCoordinate NEW for "..tostring(self.PositionableName)) + -- Create a new POINT_VEC3 object. self.pointvec3=POINT_VEC3:NewFromVec3(PositionableVec3) + end return self.pointvec3