ARTY v1.3.2

- Fixed bug that MLRS does not fire (ammo count if weapon type is auto)
This commit is contained in:
Frank 2025-01-14 10:36:12 +01:00
parent def622a02c
commit b2dc7bc232

View File

@ -695,7 +695,7 @@ ARTY.db={
--- Arty script version. --- Arty script version.
-- @field #string version -- @field #string version
ARTY.version="1.3.1" ARTY.version="1.3.2"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -3049,7 +3049,7 @@ function ARTY:onafterOpenFire(Controllable, From, Event, To, target)
local nfire=Narty local nfire=Narty
local _type="shots" local _type="shots"
if target.weapontype==ARTY.WeaponType.Auto then if target.weapontype==ARTY.WeaponType.Auto then
nfire=Narty nfire=Nammo -- We take everything that is available
_type="shots" _type="shots"
elseif target.weapontype==ARTY.WeaponType.Cannon then elseif target.weapontype==ARTY.WeaponType.Cannon then
nfire=Narty nfire=Narty
@ -3071,6 +3071,8 @@ function ARTY:onafterOpenFire(Controllable, From, Event, To, target)
_type="cruise missiles" _type="cruise missiles"
end end
--env.info(string.format("FF type=%s, Nrockets=%d, Nfire=%d target.nshells=%d", _type, Nrockets, nfire, target.nshells))
-- Adjust if less than requested ammo is left. -- Adjust if less than requested ammo is left.
target.nshells=math.min(target.nshells, nfire) target.nshells=math.min(target.nshells, nfire)