From 1861e742b023d00c9c4288d2bfc0a03d7359ea52 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Mon, 28 May 2018 17:07:55 +0200 Subject: [PATCH] ARTY v0.9.5 Added/fixed relocate option --- Moose Development/Moose/Functional/Artillery.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Functional/Artillery.lua b/Moose Development/Moose/Functional/Artillery.lua index b6c0b86b0..1242e44cd 100644 --- a/Moose Development/Moose/Functional/Artillery.lua +++ b/Moose Development/Moose/Functional/Artillery.lua @@ -404,7 +404,7 @@ ARTY.id="ARTY | " --- Arty script version. -- @field #string version -ARTY.version="0.9.4" +ARTY.version="0.9.5" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -1284,6 +1284,7 @@ function ARTY:_OnEventShot(EventData) -- Check if number of shots reached max. local _ceasefire=false + local _relocate=false if self.Nshots >= self.currentTarget.nshells then local text=string.format("Group %s stop firing on target %s.", self.Controllable:GetName(), self.currentTarget.name) self:T(ARTY.id..text) @@ -1291,6 +1292,10 @@ function ARTY:_OnEventShot(EventData) -- Cease fire. _ceasefire=true + + if self.relocateafterfire then + _relocate=true + end end -- Check if we are (partly) out of ammo. @@ -1310,7 +1315,7 @@ function ARTY:_OnEventShot(EventData) end -- Relocate position - if self.Nshots >= self.currentTarget.nshells and self.relocateafterfire then + if _relocate then self:_Relocate() end @@ -2078,7 +2083,7 @@ function ARTY:_Relocate() end until _gotit or _n>_nmax - -- Assign relocation + -- Assign relocation. if _gotit then self:AssignMoveCoord(_new, nil, nil, false, false) end