Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Applevangelist 2025-07-03 14:59:14 +02:00
commit d7431478d1

View File

@ -246,18 +246,20 @@ end
function POSITIONABLE:GetVec3() function POSITIONABLE:GetVec3()
local DCSPositionable = self:GetDCSObject() local DCSPositionable = self:GetDCSObject()
if DCSPositionable then if DCSPositionable then
--local status, vec3 = pcall(
-- function()
-- local vec3 = DCSPositionable:getPoint()
-- return vec3
--end
--)
local vec3 = DCSPositionable:getPoint() local vec3 = DCSPositionable:getPoint()
--if status then
return vec3 if not vec3 then
--else local pos = DCSPositionable:getPosition()
--self:E( { "Cannot get Vec3 from DCS Object", Positionable = self, Alive = self:IsAlive() } ) if pos and pos.p then
--end vec3 = pos.p
else
self:E( { "Cannot get the position from DCS Object for GetVec3", Positionable = self, Alive = self:IsAlive() } )
end
end
return vec3
end end
-- ERROR! -- ERROR!
self:E( { "Cannot get the Positionable DCS Object for GetVec3", Positionable = self, Alive = self:IsAlive() } ) self:E( { "Cannot get the Positionable DCS Object for GetVec3", Positionable = self, Alive = self:IsAlive() } )
@ -388,13 +390,13 @@ function POSITIONABLE:GetCoordinate()
-- Get the current position. -- Get the current position.
local PositionableVec3 = self:GetVec3() local PositionableVec3 = self:GetVec3()
if PositionableVec3 then
local coord=COORDINATE:NewFromVec3(PositionableVec3) local coord=COORDINATE:NewFromVec3(PositionableVec3)
local heading = self:GetHeading() local heading = self:GetHeading()
coord.Heading = heading coord.Heading = heading
-- Return a new coordiante object. -- Return a new coordiante object.
return coord return coord
end
end end
-- Error message. -- Error message.