Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Applevangelist 2024-10-31 16:06:00 +01:00
commit 0d6a1644e2
2 changed files with 21 additions and 17 deletions

View File

@ -899,13 +899,13 @@ function CONTROLLABLE:CommandEPLRS( SwitchOnOff, Delay )
id = 'EPLRS', id = 'EPLRS',
params = { params = {
value = SwitchOnOff, value = SwitchOnOff,
groupId = nil, groupId = self:GetID(),
}, },
} }
if self:IsGround() then --if self:IsGround() then
CommandEPLRS.params.groupId = self:GetID() --CommandEPLRS.params.groupId = self:GetID()
end --end
if Delay and Delay > 0 then if Delay and Delay > 0 then
SCHEDULER:New( nil, self.CommandEPLRS, { self, SwitchOnOff }, Delay ) SCHEDULER:New( nil, self.CommandEPLRS, { self, SwitchOnOff }, Delay )
@ -941,7 +941,7 @@ function CONTROLLABLE:CommandSetUnlimitedFuel(OnOff, Delay)
end 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 #CONTROLLABLE self
-- @param #number Frequency Radio frequency in MHz. -- @param #number Frequency Radio frequency in MHz.
-- @param #number Modulation Radio modulation. Default `radio.modulation.AM`. -- @param #number Modulation Radio modulation. Default `radio.modulation.AM`.
@ -968,7 +968,7 @@ function CONTROLLABLE:CommandSetFrequency( Frequency, Modulation, Power, Delay )
return self return self
end 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 #CONTROLLABLE self
-- @param #number Frequency Radio frequency in MHz. -- @param #number Frequency Radio frequency in MHz.
-- @param #number Modulation Radio modulation. Default `radio.modulation.AM`. -- @param #number Modulation Radio modulation. Default `radio.modulation.AM`.
@ -1010,12 +1010,13 @@ function CONTROLLABLE:TaskEPLRS( SwitchOnOff, idx )
id = 'EPLRS', id = 'EPLRS',
params = { params = {
value = SwitchOnOff, value = SwitchOnOff,
groupId = nil, groupId = self:GetID(),
}, },
} }
if self:IsGround() then
CommandEPLRS.params.groupId = self:GetID() --if self:IsGround() then
end --CommandEPLRS.params.groupId = self:GetID()
--end
return self:TaskWrappedAction( CommandEPLRS, idx or 1 ) return self:TaskWrappedAction( CommandEPLRS, idx or 1 )
end end

View File

@ -360,7 +360,7 @@ end
-- @return DCS#Group The DCS Group. -- @return DCS#Group The DCS Group.
function GROUP:GetDCSObject() 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. -- Get DCS group.
local DCSGroup = Group.getByName( self.GroupName ) local DCSGroup = Group.getByName( self.GroupName )
@ -369,14 +369,14 @@ function GROUP:GetDCSObject()
self.LastCallDCSObject = timer.getTime() self.LastCallDCSObject = timer.getTime()
self.DCSObject = DCSGroup self.DCSObject = DCSGroup
return DCSGroup return DCSGroup
else -- else
self.DCSObject = nil -- self.DCSObject = nil
self.LastCallDCSObject = nil -- self.LastCallDCSObject = nil
end end
else --else
return self.DCSObject --return self.DCSObject
end --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))) --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 return nil
@ -493,13 +493,16 @@ function GROUP:Destroy( GenerateEvent, delay )
if GenerateEvent and GenerateEvent == true then if GenerateEvent and GenerateEvent == true then
if self:IsAir() then if self:IsAir() then
self:CreateEventCrash( timer.getTime(), UnitData ) self:CreateEventCrash( timer.getTime(), UnitData )
--self:ScheduleOnce(1,self.CreateEventCrash,self,timer.getTime(),UnitData)
else else
self:CreateEventDead( timer.getTime(), UnitData ) self:CreateEventDead( timer.getTime(), UnitData )
--self:ScheduleOnce(1,self.CreateEventDead,self,timer.getTime(),UnitData)
end end
elseif GenerateEvent == false then elseif GenerateEvent == false then
-- Do nothing! -- Do nothing!
else else
self:CreateEventRemoveUnit( timer.getTime(), UnitData ) self:CreateEventRemoveUnit( timer.getTime(), UnitData )
--self:ScheduleOnce(1,self.CreateEventRemoveUnit,self,timer.getTime(),UnitData)
end end
end end
USERFLAG:New( self:GetName() ):Set( 100 ) USERFLAG:New( self:GetName() ):Set( 100 )