Skip to content

Commit

Permalink
TARGET v0.7.1
Browse files Browse the repository at this point in the history
- Fixed bug if TARGET is a COORDINATE or ZONE, where we cannot check if it is alive or dead. The count alive previously did not count coordinates or zones. Now it does, which is more consistent as we set life=1 and alive=true for these.
  • Loading branch information
funkyfranky committed Nov 23, 2024
1 parent 6f724c6 commit 6022a39
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Moose Development/Moose/Ops/Target.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ _TARGETID=0

--- TARGET class version.
-- @field #string version
TARGET.version="0.7.0"
TARGET.version="0.7.1"

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list
Expand Down Expand Up @@ -1068,6 +1068,8 @@ function TARGET:_AddObject(Object)

target.Life0=1
target.Life=1

target.N0=target.N0+1

elseif Object:IsInstanceOf("ZONE_BASE") then

Expand All @@ -1081,6 +1083,8 @@ function TARGET:_AddObject(Object)

target.Life0=1
target.Life=1

target.N0=target.N0+1

elseif Object:IsInstanceOf("OPSZONE") then

Expand Down Expand Up @@ -2008,12 +2012,16 @@ function TARGET:CountObjectives(Target, Coalitions)

elseif Target.Type==TARGET.ObjectType.COORDINATE then

-- No target we can check!
-- No target, where we can check the alive status, so we assume it is alive. Changed this because otherwise target count is 0 if we pass a coordinate.
-- This is also more consitent with the life and is alive status.
N=N+1

elseif Target.Type==TARGET.ObjectType.ZONE then

-- No target we can check!

-- No target, where we can check the alive status, so we assume it is alive. Changed this because otherwise target count is 0 if we pass a coordinate.
-- This is also more consitent with the life and is alive status.
N=N+1

elseif Target.Type==TARGET.ObjectType.OPSZONE then

local target=Target.Object --Ops.OpsZone#OPSZONE
Expand Down

0 comments on commit 6022a39

Please sign in to comment.