mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-27 07:15:24 +00:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -1812,7 +1812,7 @@ function OPSGROUP:GetVec3(UnitName)
|
||||
local carrier=self:_GetMyCarrierElement()
|
||||
if carrier and carrier.status~=OPSGROUP.ElementStatus.DEAD and self:IsLoaded() then
|
||||
local unit=carrier.unit
|
||||
if unit and unit:IsAlive()~=nil then
|
||||
if unit and unit:IsExist() then
|
||||
vec3=unit:GetVec3()
|
||||
return vec3
|
||||
end
|
||||
@@ -12813,7 +12813,7 @@ function OPSGROUP:GetAmmoTot()
|
||||
for _,_unit in pairs(units or {}) do
|
||||
local unit=_unit --Wrapper.Unit#UNIT
|
||||
|
||||
if unit and unit:IsAlive()~=nil then
|
||||
if unit and unit:IsExist() then
|
||||
|
||||
-- Get ammo of the unit.
|
||||
local ammo=self:GetAmmoUnit(unit)
|
||||
@@ -12850,8 +12850,6 @@ function OPSGROUP:GetAmmoUnit(unit, display)
|
||||
display=false
|
||||
end
|
||||
|
||||
unit=unit or self.group:GetUnit(1)
|
||||
|
||||
-- Init counter.
|
||||
local nammo=0
|
||||
local nshells=0
|
||||
@@ -12866,6 +12864,10 @@ function OPSGROUP:GetAmmoUnit(unit, display)
|
||||
local ntorps=0
|
||||
local nbombs=0
|
||||
|
||||
unit=unit or self.group:GetUnit(1)
|
||||
|
||||
if unit and unit:IsExist() then
|
||||
|
||||
-- Output.
|
||||
local text=string.format("OPSGROUP group %s - unit %s:\n", self.groupname, unit:GetName())
|
||||
|
||||
@@ -12979,6 +12981,8 @@ function OPSGROUP:GetAmmoUnit(unit, display)
|
||||
self:T3(self.lid..text)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Total amount of ammunition.
|
||||
nammo=nshells+nrockets+nmissiles+nbombs+ntorps
|
||||
|
||||
|
||||
Reference in New Issue
Block a user