Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
funkyfranky committed Nov 24, 2024
2 parents 6022a39 + 8021392 commit c4d0319
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Moose Development/Moose/Wrapper/Unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit c4d0319

Please sign in to comment.