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

This commit is contained in:
Applevangelist 2024-06-09 18:32:28 +02:00
commit 2262f27d18
3 changed files with 132 additions and 130 deletions

View File

@ -1301,7 +1301,7 @@ function EVENT:onEvent( Event )
-- STATIC
---
Event.TgtDCSUnit = Event.target
if Event.target:isExist() and Event.id ~= 33 then -- leave out ejected seat object
if Event.target.isExist and Event.target:isExist() and Event.id ~= 33 then -- leave out ejected seat object, check that isExist exists (Kiowa Hellfire issue, Special K)
Event.TgtDCSUnitName = Event.TgtDCSUnit:getName()
-- Workaround for borked target info on cruise missiles
if Event.TgtDCSUnitName and Event.TgtDCSUnitName ~= "" then

View File

@ -2484,7 +2484,7 @@ function UTILS.SaveToFile(Path,Filename,Data)
return true
end
--- Function to save an object to a file
--- Function to load an object from a file.
-- @param #string Path The path to use. Use double backslashes \\\\ on Windows filesystems.
-- @param #string Filename The name of the file.
-- @return #boolean outcome True if reading is possible and successful, else false.

View File

@ -1210,15 +1210,17 @@ function GROUP:GetCoordinate()
-- no luck, try the API way
local DCSGroup = Group.getByName(self.GroupName)
local DCSUnits = DCSGroup:getUnits() or {}
for _,_unit in pairs(DCSUnits) do
if Object.isExist(_unit) then
local position = _unit:getPosition()
local point = position.p ~= nil and position.p or _unit:GetPoint()
if point then
--self:I(point)
local coord = COORDINATE:NewFromVec3(point)
return coord
if DCSGroup then
local DCSUnits = DCSGroup:getUnits() or {}
for _,_unit in pairs(DCSUnits) do
if Object.isExist(_unit) then
local position = _unit:getPosition()
local point = position.p ~= nil and position.p or _unit:GetPoint()
if point then
--self:I(point)
local coord = COORDINATE:NewFromVec3(point)
return coord
end
end
end
end