mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
xx
This commit is contained in:
@@ -1351,7 +1351,7 @@ CTLD.UnitTypeCapabilities = {
|
||||
|
||||
--- CTLD class version.
|
||||
-- @field #string version
|
||||
CTLD.version="1.1.19"
|
||||
CTLD.version="1.1.20"
|
||||
|
||||
--- Instantiate a new CTLD.
|
||||
-- @param #CTLD self
|
||||
@@ -5389,6 +5389,27 @@ end
|
||||
return Stock
|
||||
end
|
||||
|
||||
--- User - Query the cargo loaded from a specific unit
|
||||
-- @param #CTLD self
|
||||
-- @param Wrapper.Unit#UNIT Unit The (client) unit to query.
|
||||
-- @return #number Troopsloaded
|
||||
-- @return #number Cratesloaded
|
||||
-- @return #table Cargo Table of #CTLD_CARGO objects
|
||||
function CTLD:GetLoadedCargo(Unit)
|
||||
local Troops = 0
|
||||
local Crates = 0
|
||||
local Cargo = {}
|
||||
if Unit and Unit:IsAlive() then
|
||||
local name = Unit:GetName()
|
||||
if self.Loaded_Cargo[name] then
|
||||
Troops = self.Loaded_Cargo[name].Troopsloaded or 0
|
||||
Crates = self.Loaded_Cargo[name].Cratesloaded or 0
|
||||
Cargo = self.Loaded_Cargo[name].Cargo or {}
|
||||
end
|
||||
end
|
||||
return Troops, Crates, Cargo
|
||||
end
|
||||
|
||||
--- User - function to get a table of statics cargo in stock
|
||||
-- @param #CTLD self
|
||||
-- @return #table Table Table of Stock, indexed by cargo type name
|
||||
|
||||
Reference in New Issue
Block a user