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
2262f27d18
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user