mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
2cedb5e996
@ -646,7 +646,7 @@ AIRBASE.SouthAtlantic={
|
||||
-- * AIRBASE.Sinai.Tel_Nof
|
||||
-- * AIRBASE.Sinai.Abu_Rudeis
|
||||
-- * AIRBASE.Sinai.Inshas_Airbase
|
||||
-- * AIRBASE.Sinai.Ben-Gurion
|
||||
-- * AIRBASE.Sinai.Ben_Gurion
|
||||
-- * AIRBASE.Sinai.Bir_Hasanah
|
||||
-- * AIRBASE.Sinai.Cairo_West
|
||||
--
|
||||
|
||||
@ -237,22 +237,23 @@ end
|
||||
-- @return DCS#Vec3 The 3D point vector of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetVec3()
|
||||
|
||||
local DCSPositionable = self:GetDCSObject()
|
||||
|
||||
if DCSPositionable then
|
||||
|
||||
local status, vec3 = pcall(
|
||||
function()
|
||||
local vec3 = DCSPositionable:getPoint()
|
||||
|
||||
if vec3 then
|
||||
return vec3
|
||||
end
|
||||
)
|
||||
--local vec3 = DCSPositionable:getPoint()
|
||||
if status then
|
||||
return vec3
|
||||
else
|
||||
self:E( "ERROR: Cannot get vec3!" )
|
||||
self:E( { "Cannot get Vec3 from DCS Object", Positionable = self, Alive = self:IsAlive() } )
|
||||
end
|
||||
end
|
||||
|
||||
-- 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
|
||||
end
|
||||
|
||||
|
||||
@ -701,17 +701,24 @@ end
|
||||
-- @return DCS#Unit.Ammo Table with ammuntion of the unit (or nil). This can be a complex table!
|
||||
function UNIT:GetAmmo()
|
||||
self:F2( self.UnitName )
|
||||
|
||||
local DCSUnit = self:GetDCSObject()
|
||||
|
||||
if DCSUnit then
|
||||
local status, unitammo = pcall(
|
||||
function()
|
||||
local UnitAmmo = DCSUnit:getAmmo()
|
||||
return UnitAmmo
|
||||
end
|
||||
|
||||
)
|
||||
if status then
|
||||
return unitammo
|
||||
end
|
||||
--local UnitAmmo = DCSUnit:getAmmo()
|
||||
--return UnitAmmo
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Sets the Unit's Internal Cargo Mass, in kg
|
||||
-- @param #UNIT self
|
||||
-- @param #number mass to set cargo to
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user