Small changes

#CSAR - add option for IR strobe
This commit is contained in:
Applevangelist
2024-09-08 13:22:10 +02:00
parent d62025dfe0
commit 7f572a1a9b
3 changed files with 149 additions and 73 deletions

View File

@@ -360,14 +360,25 @@ end
-- @return DCS#Group The DCS Group.
function GROUP:GetDCSObject()
-- Get DCS group.
local DCSGroup = Group.getByName( self.GroupName )
if (not self.LastCallDCSObject) or (self.LastCallDCSObject and timer.getTime() - self.LastCallDCSObject > 1) then
if DCSGroup then
return DCSGroup
-- Get DCS group.
local DCSGroup = Group.getByName( self.GroupName )
if DCSGroup then
self.LastCallDCSObject = timer.getTime()
self.DCSObject = DCSGroup
return DCSGroup
else
self.DCSObject = nil
self.LastCallDCSObject = nil
end
else
return self.DCSObject
end
--self:T2(string.format("ERROR: Could not get DCS group object of group %s because DCS object could not be found!", tostring(self.GroupName)))
--self:E(string.format("ERROR: Could not get DCS group object of group %s because DCS object could not be found!", tostring(self.GroupName)))
return nil
end