mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#CTLD - Dyn CArgo Spawns Handling
This commit is contained in:
@@ -178,7 +178,7 @@ end
|
||||
-- @param #STATIC self
|
||||
-- @return DCS static object
|
||||
function STATIC:GetDCSObject()
|
||||
local DCSStatic = StaticObject.getByName( self.StaticName )
|
||||
local DCSStatic = StaticObject.getByName( self.StaticName )
|
||||
|
||||
if DCSStatic then
|
||||
return DCSStatic
|
||||
@@ -339,3 +339,17 @@ function STATIC:GetStaticStorage()
|
||||
local storage = STORAGE:NewFromStaticCargo(name)
|
||||
return storage
|
||||
end
|
||||
|
||||
--- Get the Cargo Weight of a static object in kgs. Returns -1 if not found.
|
||||
-- @param #STATIC self
|
||||
-- @return #number Mass Weight in kgs.
|
||||
function STATIC:GetCargoWeight()
|
||||
local DCSObject = StaticObject.getByName(self.StaticName )
|
||||
local mass = -1
|
||||
if DCSObject then
|
||||
mass = DCSObject:getCargoWeight() or 0
|
||||
local masstxt = DCSObject:getCargoDisplayName() or "none"
|
||||
BASE:I("GetCargoWeight "..tostring(mass).." MassText "..masstxt)
|
||||
end
|
||||
return mass
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user