From 9cac2674c4b60c3190889054cdcf9b65798df0bf Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 16 Nov 2020 13:22:53 +0100 Subject: [PATCH] Update Target.lua - Alive checks improved --- Moose Development/Moose/Ops/Target.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/Target.lua b/Moose Development/Moose/Ops/Target.lua index 2c53abd12..3ab5aa43b 100644 --- a/Moose Development/Moose/Ops/Target.lua +++ b/Moose Development/Moose/Ops/Target.lua @@ -113,7 +113,7 @@ _TARGETID=0 --- TARGET class version. -- @field #string version -TARGET.version="0.1.0" +TARGET.version="0.2.0" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -494,7 +494,7 @@ function TARGET:_AddObject(Object) target.Coordinate=unit:GetCoordinate() - if unit and unit:IsAlive() then + if unit then target.Life=unit:GetLife() target.Life0=math.max(unit:GetLife0(), target.Life) -- There was an issue with ships that life is greater life0! @@ -901,7 +901,7 @@ function TARGET:GetTargetCategory(Target) elseif Target.Type==TARGET.ObjectType.UNIT then - if Target.Object and Target.Object:IsAlive() then + if Target.Object and Target.Object:IsAlive()~=nil then local unit=Target.Object --Wrapper.Unit#UNIT local group=unit:GetGroup()