Skip to content

Commit 49068af

Browse files
authored
fix: MultiConfig lua set and reset subProtocol (#672)
1 parent fbd81c6 commit 49068af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lua_scripts/MultiConfig.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ local ModuleNumber = 0
4848
local ModuleType = ""
4949
local Module = {}
5050
local InitialProtocol = 0
51+
local InitialSubProtocol = 0
5152

5253
function bitand(a, b)
5354
local result = 0
@@ -76,6 +77,7 @@ end
7677
local function Config_Release()
7778
--Set the protocol back to what it was
7879
Module.protocol = InitialProtocol
80+
Module.subProtocol = InitialSubProtocol
7981
model.setModule(ModuleNumber, Module)
8082

8183
--Stop requesting updates
@@ -422,7 +424,9 @@ local function Config_Init()
422424
--Get Module settings and set it to config protocol
423425
Module = model.getModule(ModuleNumber)
424426
InitialProtocol = Module.protocol
427+
InitialSubProtocol = Module.subProtocol
425428
Module.protocol = 86
429+
Module.subProtocol = 0
426430
model.setModule(ModuleNumber, Module)
427431
--pause while waiting for the module to switch to config
428432
for i = 0, 10, 1 do end

0 commit comments

Comments
 (0)