From c8780b2d5fdea787422549244a695d45e2d2c9c7 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 12 Feb 2023 13:00:19 +0100 Subject: [PATCH] Update Range.lua - Coordinate of bomb target is now always updated (not only for moving targets) - If the target is not alive any more, the last known position is used for its coordinate --- Moose Development/Moose/Functional/Range.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Functional/Range.lua b/Moose Development/Moose/Functional/Range.lua index c3425f26b..ad681b8eb 100644 --- a/Moose Development/Moose/Functional/Range.lua +++ b/Moose Development/Moose/Functional/Range.lua @@ -3474,17 +3474,18 @@ function RANGE:_GetBombTargetCoordinate( target ) local coord = nil -- Core.Point#COORDINATE if target.type == RANGE.TargetType.UNIT then - - if not target.move then - -- Target should not move. - coord = target.coordinate + + -- Check if alive + if target.target and target.target:IsAlive() then + -- Get current position. + coord = target.target:GetCoordinate() + -- Save as last known position in case target dies. + target.coordinate=coord else - -- Moving target. Check if alive and get current position - if target.target and target.target:IsAlive() then - coord = target.target:GetCoordinate() - end + -- Use stored position. + coord = target.coordinate end - + elseif target.type == RANGE.TargetType.STATIC then -- Static targets dont move.