mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#DYNAMICCARGO - Added functionalty
This commit is contained in:
@@ -226,6 +226,26 @@ function STORAGE:NewFromStaticCargo(StaticCargoName)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Create a new STORAGE object from an DCS static cargo object.
|
||||
-- @param #STORAGE self
|
||||
-- @param #string DynamicCargoName Unit name of the dynamic cargo.
|
||||
-- @return #STORAGE self
|
||||
function STORAGE:NewFromDynamicCargo(DynamicCargoName)
|
||||
|
||||
-- Inherit everything from BASE class.
|
||||
local self=BASE:Inherit(self, BASE:New()) -- #STORAGE
|
||||
|
||||
self.airbase=Unit.getByName(DynamicCargoName)
|
||||
|
||||
if Airbase.getWarehouse then
|
||||
self.warehouse=Warehouse.getCargoAsWarehouse(self.airbase)
|
||||
end
|
||||
|
||||
self.lid = string.format("STORAGE %s", DynamicCargoName)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Airbases only - Find a STORAGE in the **_DATABASE** using the name associated airbase.
|
||||
-- @param #STORAGE self
|
||||
|
||||
Reference in New Issue
Block a user