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) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-07 15:31:18 +00:00
co-authored by Claude Opus 5
parent 4745b6de0b
commit b07052307d
5 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -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<uint, [string, string]>
local translations = {} --- @type table<string, table<string, string>>
Storage.register({
pending,
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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"
@@ -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]
@@ -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,