mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
# DCS 2.9.7.58923 - Fixes for the Chinhook and handling of dynamically spawned cargo stuff. Additional Kola airbase names.
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
|
||||
@@ -330,3 +330,26 @@ function STATIC:FindAllByMatching( Pattern )
|
||||
|
||||
return GroupsFound
|
||||
end
|
||||
|
||||
--- Get the Wrapper.Storage#STORAGE object of an static if it is used as cargo and has been set up as storage object.
|
||||
-- @param #STATIC self
|
||||
-- @return Wrapper.Storage#STORAGE Storage or `nil` if not fund or set up.
|
||||
function STATIC:GetStaticStorage()
|
||||
local name = self:GetName()
|
||||
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