Merge branch 'master' into develop

This commit is contained in:
Frank 2024-11-24 21:54:19 +01:00
commit c4d0319bb2

View File

@ -240,7 +240,9 @@ end
-- @return DCS#Unit The DCS Group.
function UNIT:GetDCSObject()
if (not self.LastCallDCSObject) or (self.LastCallDCSObject and timer.getTime() - self.LastCallDCSObject > 1) then
-- FF: Added checks that DCSObject exists because otherwise there were problems when respawning the unit right after it was initially spawned (e.g. teleport in OPSGROUP).
-- Got "Unit does not exit" after coalition.addGroup() when trying to access unit data because LastCallDCSObject<=1.
if (not self.LastCallDCSObject) or (self.LastCallDCSObject and timer.getTime()-self.LastCallDCSObject>1) or (self.DCSObject==nil) or (self.DCSObject:isExist()==false) then
-- Get DCS group.
local DCSUnit = Unit.getByName( self.UnitName )