This commit is contained in:
Applevangelist 2023-06-13 08:35:27 +02:00
parent 3d4eb1545e
commit 253ed62d46
4 changed files with 25 additions and 17 deletions

View File

@ -3040,7 +3040,7 @@ do -- SET_UNIT
-- @param Wrapper.Unit#UNIT MUnit -- @param Wrapper.Unit#UNIT MUnit
-- @return #SET_UNIT self -- @return #SET_UNIT self
function SET_UNIT:IsIncludeObject( MUnit ) function SET_UNIT:IsIncludeObject( MUnit )
self:F2( MUnit ) self:F2( {MUnit} )
local MUnitInclude = false local MUnitInclude = false

View File

@ -679,7 +679,7 @@ AIRBASE.Sinai = {
["Tel_Nof"] = "Tel Nof", ["Tel_Nof"] = "Tel Nof",
["Abu_Rudeis"] = "Abu Rudeis", ["Abu_Rudeis"] = "Abu Rudeis",
["Inshas_Airbase"] = "Inshas Airbase", ["Inshas_Airbase"] = "Inshas Airbase",
["Ben-Gurion"] = "Ben-Gurion", ["Ben_Gurion"] = "Ben-Gurion",
["Bir_Hasanah"] = "Bir Hasanah", ["Bir_Hasanah"] = "Bir Hasanah",
["Cairo_West"] = "Cairo West", ["Cairo_West"] = "Cairo West",
} }

View File

@ -237,22 +237,23 @@ end
-- @return DCS#Vec3 The 3D point vector of the POSITIONABLE. -- @return DCS#Vec3 The 3D point vector of the POSITIONABLE.
-- @return #nil The POSITIONABLE is not existing or alive. -- @return #nil The POSITIONABLE is not existing or alive.
function POSITIONABLE:GetVec3() function POSITIONABLE:GetVec3()
local DCSPositionable = self:GetDCSObject() local DCSPositionable = self:GetDCSObject()
if DCSPositionable then if DCSPositionable then
local status, vec3 = pcall(
local vec3 = DCSPositionable:getPoint() function()
local vec3 = DCSPositionable:getPoint()
if vec3 then return vec3
end
)
--local vec3 = DCSPositionable:getPoint()
if status then
return vec3 return vec3
else else
self:E( "ERROR: Cannot get vec3!" ) self:E( { "Cannot get Vec3 from DCS Object", Positionable = self, Alive = self:IsAlive() } )
end end
end end
-- ERROR! -- ERROR!
self:E( { "Cannot GetVec3", Positionable = self, Alive = self:IsAlive() } ) self:E( { "Cannot get the Positionable DCS Object for GetVec3", Positionable = self, Alive = self:IsAlive() } )
return nil return nil
end end

View File

@ -681,20 +681,27 @@ end
--- Returns the Unit's ammunition. --- Returns the Unit's ammunition.
-- @param #UNIT self -- @param #UNIT self
-- @return DCS#Unit.Ammo Table with ammuntion of the unit (or nil). This can be a complex table! -- @return DCS#Unit.Ammo Table with ammuntion of the unit (or nil). This can be a complex table!
function UNIT:GetAmmo() function UNIT:GetAmmo()
self:F2( self.UnitName ) self:F2( self.UnitName )
local DCSUnit = self:GetDCSObject() local DCSUnit = self:GetDCSObject()
if DCSUnit then if DCSUnit then
local UnitAmmo = DCSUnit:getAmmo() local status, unitammo = pcall(
return UnitAmmo function()
local UnitAmmo = DCSUnit:getAmmo()
return UnitAmmo
end
)
if status then
return unitammo
end
--local UnitAmmo = DCSUnit:getAmmo()
--return UnitAmmo
end end
return nil return nil
end end
--- Sets the Unit's Internal Cargo Mass, in kg --- Sets the Unit's Internal Cargo Mass, in kg
-- @param #UNIT self -- @param #UNIT self
-- @param #number mass to set cargo to -- @param #number mass to set cargo to