Update Group.lua

- Fixed SetInvisible and SetImmortal functions to acknowledge parameter false.
This commit is contained in:
Frank 2021-10-12 22:16:18 +02:00
parent 8b9143d3f1
commit 67f847dd16

View File

@ -2578,8 +2578,10 @@ end
-- @return #GROUP self -- @return #GROUP self
function GROUP:SetCommandInvisible(switch) function GROUP:SetCommandInvisible(switch)
self:F2( self.GroupName ) self:F2( self.GroupName )
local switch = switch or false if switch==nil then
local SetInvisible = {id = 'SetInvisible', params = {value = true}} switch=false
end
local SetInvisible = {id = 'SetInvisible', params = {value = switch}}
self:SetCommand(SetInvisible) self:SetCommand(SetInvisible)
return self return self
end end
@ -2590,9 +2592,11 @@ end
-- @return #GROUP self -- @return #GROUP self
function GROUP:SetCommandImmortal(switch) function GROUP:SetCommandImmortal(switch)
self:F2( self.GroupName ) self:F2( self.GroupName )
local switch = switch or false if switch==nil then
local SetInvisible = {id = 'SetImmortal', params = {value = true}} switch=false
self:SetCommand(SetInvisible) end
local SetImmortal = {id = 'SetImmortal', params = {value = switch}}
self:SetCommand(SetImmortal)
return self return self
end end