From b07052307d7e4fc908268c555048cda8021283e1 Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Thu, 6 Aug 2026 21:48:21 +0000 Subject: [PATCH] Fix stale vlayer signals and index types `LogisticFilter.signal` became `value` in 2.0, so the clear loop broke on the first slot and outdated signals were left behind. Co-Authored-By: Claude Opus 5 (1M context) --- exp_commands/module/search.lua | 2 +- exp_legacy/module/modules/control/vlayer.lua | 2 +- exp_scenario/module/commands/roles.lua | 2 +- exp_scenario/module/control/discord_alerts.lua | 2 +- exp_scenario/module/gui/production_stats.lua | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/exp_commands/module/search.lua b/exp_commands/module/search.lua index d2e3fef9..8e0176e9 100644 --- a/exp_commands/module/search.lua +++ b/exp_commands/module/search.lua @@ -3,7 +3,7 @@ local Search = {} local Storage = require("modules/exp_util/storage") --- Setup the storage to contain the pending translations and the completed ones -local pending = {} --- @type { [1]: string, [2]: string }[] +local pending = {} --- @type table local translations = {} --- @type table> Storage.register({ pending, diff --git a/exp_legacy/module/modules/control/vlayer.lua b/exp_legacy/module/modules/control/vlayer.lua index d70b15f8..3730834d 100644 --- a/exp_legacy/module/modules/control/vlayer.lua +++ b/exp_legacy/module/modules/control/vlayer.lua @@ -617,7 +617,7 @@ local function handle_circuit_interfaces() -- Clear remaining signals to prevent outdated values being present (caused by count > 0 check) for clear_index = signal_index, #circuit do - if not circuit_oc.get_slot(clear_index).signal then + if not circuit_oc.get_slot(clear_index).value then break -- There are no more signals to clear end diff --git a/exp_scenario/module/commands/roles.lua b/exp_scenario/module/commands/roles.lua index eb2ec833..7cbfd8d0 100644 --- a/exp_scenario/module/commands/roles.lua +++ b/exp_scenario/module/commands/roles.lua @@ -42,7 +42,7 @@ Commands.new("get-roles", { "exp-commands_roles.description-get" }) --- @cast other_player LuaPlayer? local roles = get_roles_ordered() local roles_formatted = { "" } --- @type LocalisedString - local response = { "exp-commands_roles.list-roles", roles_formatted } + local response = { "exp-commands_roles.list-roles", roles_formatted } --[[@as LocalisedString]] if other_player then roles = get_player_roles(other_player) response[1] = "exp-commands_roles.list-player" diff --git a/exp_scenario/module/control/discord_alerts.lua b/exp_scenario/module/control/discord_alerts.lua index 5fc894f1..249a3e2e 100644 --- a/exp_scenario/module/control/discord_alerts.lua +++ b/exp_scenario/module/control/discord_alerts.lua @@ -31,7 +31,7 @@ local function append_playtime(player_name) end --- Get the player name from an event ---- @param event { player_index: number, by_player_name: string? } +--- @param event { player_index: uint, by_player_name: string? } --- @return string, string local function get_player_name(event) local player = game.players[event.player_index] diff --git a/exp_scenario/module/gui/production_stats.lua b/exp_scenario/module/gui/production_stats.lua index 2c480d0b..10963298 100644 --- a/exp_scenario/module/gui/production_stats.lua +++ b/exp_scenario/module/gui/production_stats.lua @@ -9,6 +9,7 @@ local Roles = require("modules/exp_legacy/expcore/roles") local Elements = {} --- The flow precision values in the same order as production_precision_dropdown.items +--- @type defines.flow_precision_index[] local precision_indexes = { defines.flow_precision_index.five_seconds, defines.flow_precision_index.one_minute,