From 90096163ee353327168d2216f8acd25fb1ed50c7 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 26 Oct 2024 18:44:57 +0200 Subject: [PATCH] EPLRS - give group ID only if ground --- Moose Development/Moose/Wrapper/Controllable.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 68d16001a..9ee8844be 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -899,10 +899,14 @@ function CONTROLLABLE:CommandEPLRS( SwitchOnOff, Delay ) id = 'EPLRS', params = { value = SwitchOnOff, - groupId = self:GetID(), + groupId = nil, }, } - + + if self:IsGround() then + CommandEPLRS.params.groupId = self:GetID() + end + if Delay and Delay > 0 then SCHEDULER:New( nil, self.CommandEPLRS, { self, SwitchOnOff }, Delay ) else @@ -1006,10 +1010,13 @@ function CONTROLLABLE:TaskEPLRS( SwitchOnOff, idx ) id = 'EPLRS', params = { value = SwitchOnOff, - groupId = self:GetID(), + groupId = nil, }, } - + if self:IsGround() then + CommandEPLRS.params.groupId = self:GetID() + end + return self:TaskWrappedAction( CommandEPLRS, idx or 1 ) end