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
@@ -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 vec3 = DCSPositionable:getPoint()
if vec3 then
local status, vec3 = pcall(
function()
local vec3 = DCSPositionable:getPoint()
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