GROUP:GetAmmunition() - fix to also return bomb count (#1606)

GROUP:GetAmmunition() - fix to also return bomb count
This commit is contained in:
Applevangelist 2021-09-28 16:53:53 +02:00 committed by GitHub
parent db516a2077
commit c311c40b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1137,7 +1137,7 @@ end
-- @return #number Number of shells left.
-- @return #number Number of rockets left.
-- @return #number Number of bombs left.
-- @return #number Number of missiles left.
-- @return #number Number of missiles left.
function GROUP:GetAmmunition()
self:F( self.ControllableName )
@ -1147,6 +1147,7 @@ function GROUP:GetAmmunition()
local Nshells=0
local Nrockets=0
local Nmissiles=0
local Nbombs=0
if DCSControllable then
@ -1155,18 +1156,19 @@ function GROUP:GetAmmunition()
local Unit = UnitData -- Wrapper.Unit#UNIT
-- Get ammo of the unit
local ntot, nshells, nrockets, nmissiles = Unit:GetAmmunition()
local ntot, nshells, nrockets, nbombs, nmissiles = Unit:GetAmmunition()
Ntot=Ntot+ntot
Nshells=Nshells+nshells
Nrockets=Nrockets+nrockets
Nmissiles=Nmissiles+nmissiles
Nmissiles=Nmissiles+nmissiles
Nbombs=Nbombs+nbombs
end
end
return Ntot, Nshells, Nrockets, Nmissiles
return Ntot, Nshells, Nrockets, Nbombs, Nmissiles
end