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 -- STATIC
--- ---
Event.TgtDCSUnit = Event.target 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() Event.TgtDCSUnitName = Event.TgtDCSUnit:getName()
-- Workaround for borked target info on cruise missiles -- Workaround for borked target info on cruise missiles
if Event.TgtDCSUnitName and Event.TgtDCSUnitName ~= "" then if Event.TgtDCSUnitName and Event.TgtDCSUnitName ~= "" then

View File

@ -2484,7 +2484,7 @@ function UTILS.SaveToFile(Path,Filename,Data)
return true return true
end 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 Path The path to use. Use double backslashes \\\\ on Windows filesystems.
-- @param #string Filename The name of the file. -- @param #string Filename The name of the file.
-- @return #boolean outcome True if reading is possible and successful, else false. -- @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 -- no luck, try the API way
local DCSGroup = Group.getByName(self.GroupName) local DCSGroup = Group.getByName(self.GroupName)
local DCSUnits = DCSGroup:getUnits() or {} if DCSGroup then
for _,_unit in pairs(DCSUnits) do local DCSUnits = DCSGroup:getUnits() or {}
if Object.isExist(_unit) then for _,_unit in pairs(DCSUnits) do
local position = _unit:getPosition() if Object.isExist(_unit) then
local point = position.p ~= nil and position.p or _unit:GetPoint() local position = _unit:getPosition()
if point then local point = position.p ~= nil and position.p or _unit:GetPoint()
--self:I(point) if point then
local coord = COORDINATE:NewFromVec3(point) --self:I(point)
return coord local coord = COORDINATE:NewFromVec3(point)
return coord
end
end end
end end
end end