From 24efb82d0f824cf0cc9545868760d86fe776e754 Mon Sep 17 00:00:00 2001 From: Bastiaan <17990055+bbassie@users.noreply.github.com> Date: Wed, 9 Sep 2026 16:47:01 +0200 Subject: [PATCH] Encode group permissions as a 1-based array (#472) encode_group_permissions filled the whitelist and blacklist starting at index 0. Factorio's table_to_json only serialises a table as a JSON array when its keys run 1..n, so the permissions reached the instance plugin as an object and every GroupUpdateRequest failed schema validation. Co-authored-by: Claude Fable 5.1 --- exp_groups/module/control.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exp_groups/module/control.lua b/exp_groups/module/control.lua index 232fd6e3..6203b1c5 100644 --- a/exp_groups/module/control.lua +++ b/exp_groups/module/control.lua @@ -102,11 +102,11 @@ local function encode_group_permissions(group) local allows_action = group.allows_action for input_action_name, input_action in pairs(defines.input_action) do if allows_action(input_action) then - whitelist[whitelist_index] = input_action_name whitelist_index = whitelist_index + 1 + whitelist[whitelist_index] = input_action_name else - blacklist[blacklist_index] = input_action_name blacklist_index = blacklist_index + 1 + blacklist[blacklist_index] = input_action_name end end