This commit is contained in:
Applevangelist 2024-09-23 13:43:05 +02:00
parent 1f3df107bf
commit e0e4ba7db3
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ end
-- @param #DYNAMICCARGO self -- @param #DYNAMICCARGO self
-- @return DCS static object -- @return DCS static object
function DYNAMICCARGO:GetDCSObject() function DYNAMICCARGO:GetDCSObject()
local DCSStatic = Unit.getByName( self.StaticName ) local DCSStatic = StaticObject.getByName( self.StaticName ) or Unit.getByName( self.StaticName )
if DCSStatic then if DCSStatic then
return DCSStatic return DCSStatic
end end

View File

@ -226,7 +226,7 @@ function STORAGE:NewFromStaticCargo(StaticCargoName)
return self return self
end end
--- Create a new STORAGE object from an DCS static cargo object. --- Create a new STORAGE object from a Wrapper.DynamicCargo#DYNAMICCARGO object.
-- @param #STORAGE self -- @param #STORAGE self
-- @param #string DynamicCargoName Unit name of the dynamic cargo. -- @param #string DynamicCargoName Unit name of the dynamic cargo.
-- @return #STORAGE self -- @return #STORAGE self
@ -235,7 +235,7 @@ function STORAGE:NewFromDynamicCargo(DynamicCargoName)
-- Inherit everything from BASE class. -- Inherit everything from BASE class.
local self=BASE:Inherit(self, BASE:New()) -- #STORAGE local self=BASE:Inherit(self, BASE:New()) -- #STORAGE
self.airbase=Unit.getByName(DynamicCargoName) self.airbase=Unit.getByName(DynamicCargoName) or StaticObject.getByName(DynamicCargoName)
if Airbase.getWarehouse then if Airbase.getWarehouse then
self.warehouse=Warehouse.getCargoAsWarehouse(self.airbase) self.warehouse=Warehouse.getCargoAsWarehouse(self.airbase)