#CTLD - Dyn CArgo Spawns Handling

This commit is contained in:
Applevangelist
2024-08-06 18:19:35 +02:00
parent f53bd8f11a
commit 63dc9b2e8e
3 changed files with 154 additions and 19 deletions

View File

@@ -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