Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Applevangelist committed Oct 31, 2024
2 parents 1ebe8b8 + d51e761 commit 0d6a164
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
21 changes: 11 additions & 10 deletions Moose Development/Moose/Wrapper/Controllable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -899,13 +899,13 @@ function CONTROLLABLE:CommandEPLRS( SwitchOnOff, Delay )
id = 'EPLRS',
params = {
value = SwitchOnOff,
groupId = nil,
groupId = self:GetID(),
},
}

if self:IsGround() then
CommandEPLRS.params.groupId = self:GetID()
end
--if self:IsGround() then
--CommandEPLRS.params.groupId = self:GetID()
--end

if Delay and Delay > 0 then
SCHEDULER:New( nil, self.CommandEPLRS, { self, SwitchOnOff }, Delay )
Expand Down Expand Up @@ -941,7 +941,7 @@ function CONTROLLABLE:CommandSetUnlimitedFuel(OnOff, Delay)
end


--- Set radio frequency. See [DCS command EPLRS](https://wiki.hoggitworld.com/view/DCS_command_setFrequency)
--- Set radio frequency. See [DCS command SetFrequency](https://wiki.hoggitworld.com/view/DCS_command_setFrequency)
-- @param #CONTROLLABLE self
-- @param #number Frequency Radio frequency in MHz.
-- @param #number Modulation Radio modulation. Default `radio.modulation.AM`.
Expand All @@ -968,7 +968,7 @@ function CONTROLLABLE:CommandSetFrequency( Frequency, Modulation, Power, Delay )
return self
end

--- [AIR] Set radio frequency. See [DCS command EPLRS](https://wiki.hoggitworld.com/view/DCS_command_setFrequencyForUnit)
--- [AIR] Set radio frequency. See [DCS command SetFrequencyForUnit](https://wiki.hoggitworld.com/view/DCS_command_setFrequencyForUnit)
-- @param #CONTROLLABLE self
-- @param #number Frequency Radio frequency in MHz.
-- @param #number Modulation Radio modulation. Default `radio.modulation.AM`.
Expand Down Expand Up @@ -1010,12 +1010,13 @@ function CONTROLLABLE:TaskEPLRS( SwitchOnOff, idx )
id = 'EPLRS',
params = {
value = SwitchOnOff,
groupId = nil,
groupId = self:GetID(),
},
}
if self:IsGround() then
CommandEPLRS.params.groupId = self:GetID()
end

--if self:IsGround() then
--CommandEPLRS.params.groupId = self:GetID()
--end

return self:TaskWrappedAction( CommandEPLRS, idx or 1 )
end
Expand Down
17 changes: 10 additions & 7 deletions Moose Development/Moose/Wrapper/Group.lua
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ end
-- @return DCS#Group The DCS Group.
function GROUP:GetDCSObject()

if (not self.LastCallDCSObject) or (self.LastCallDCSObject and timer.getTime() - self.LastCallDCSObject > 1) then
--if (not self.LastCallDCSObject) or (self.LastCallDCSObject and timer.getTime() - self.LastCallDCSObject > 1) then

-- Get DCS group.
local DCSGroup = Group.getByName( self.GroupName )
Expand All @@ -369,14 +369,14 @@ function GROUP:GetDCSObject()
self.LastCallDCSObject = timer.getTime()
self.DCSObject = DCSGroup
return DCSGroup
else
self.DCSObject = nil
self.LastCallDCSObject = nil
-- else
-- self.DCSObject = nil
-- self.LastCallDCSObject = nil
end

else
return self.DCSObject
end
--else
--return self.DCSObject
--end

--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
Expand Down Expand Up @@ -493,13 +493,16 @@ function GROUP:Destroy( GenerateEvent, delay )
if GenerateEvent and GenerateEvent == true then
if self:IsAir() then
self:CreateEventCrash( timer.getTime(), UnitData )
--self:ScheduleOnce(1,self.CreateEventCrash,self,timer.getTime(),UnitData)
else
self:CreateEventDead( timer.getTime(), UnitData )
--self:ScheduleOnce(1,self.CreateEventDead,self,timer.getTime(),UnitData)
end
elseif GenerateEvent == false then
-- Do nothing!
else
self:CreateEventRemoveUnit( timer.getTime(), UnitData )
--self:ScheduleOnce(1,self.CreateEventRemoveUnit,self,timer.getTime(),UnitData)
end
end
USERFLAG:New( self:GetName() ):Set( 100 )
Expand Down

0 comments on commit 0d6a164

Please sign in to comment.