mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-09-21 17:04:00 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
0854a2b7d5
commit
24efb82d0f
@@ -102,11 +102,11 @@ local function encode_group_permissions(group)
|
|||||||
local allows_action = group.allows_action
|
local allows_action = group.allows_action
|
||||||
for input_action_name, input_action in pairs(defines.input_action) do
|
for input_action_name, input_action in pairs(defines.input_action) do
|
||||||
if allows_action(input_action) then
|
if allows_action(input_action) then
|
||||||
whitelist[whitelist_index] = input_action_name
|
|
||||||
whitelist_index = whitelist_index + 1
|
whitelist_index = whitelist_index + 1
|
||||||
|
whitelist[whitelist_index] = input_action_name
|
||||||
else
|
else
|
||||||
blacklist[blacklist_index] = input_action_name
|
|
||||||
blacklist_index = blacklist_index + 1
|
blacklist_index = blacklist_index + 1
|
||||||
|
blacklist[blacklist_index] = input_action_name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user