From 589b876865e84e1488dc66ba1d1d0da66b163634 Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Thu, 6 Aug 2026 21:40:16 +0000 Subject: [PATCH] Fix a nil config read and two key types `config.temp_warning_limit` does not exist, the warnings config defines `script_warning_limit`, and the locale expects it as `__3__/__4__`, so the command was printing nil. map_tags is keyed by the force name joined to the tag number, and custom_color is the Color union. Co-Authored-By: Claude Opus 5 (1M context) --- exp_legacy/module/expcore/roles.lua | 2 +- exp_scenario/module/commands/protected_tags.lua | 2 +- exp_scenario/module/commands/warnings.lua | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exp_legacy/module/expcore/roles.lua b/exp_legacy/module/expcore/roles.lua index b84875f2..940d5a67 100644 --- a/exp_legacy/module/expcore/roles.lua +++ b/exp_legacy/module/expcore/roles.lua @@ -200,7 +200,7 @@ function Roles.debug() local output = "" for index, role_name in ipairs(Roles.config.order) do local role = Roles.config.roles[role_name] - local color = role.custom_color or Colours.white + local color = role.custom_color or Colours.white --[[@as Color.struct]] local color_str = string.format("[color=%d, %d, %d]", color.r, color.g, color.b) output = output .. string.format("\n%s %s) %s[/color]", color_str, index, serpent.line(role)) end diff --git a/exp_scenario/module/commands/protected_tags.lua b/exp_scenario/module/commands/protected_tags.lua index 1667b008..fce30257 100644 --- a/exp_scenario/module/commands/protected_tags.lua +++ b/exp_scenario/module/commands/protected_tags.lua @@ -7,7 +7,7 @@ local Storage = require("modules/exp_util/storage") --- Storage variables local active_players = {} --- @type table Stores all players in in protected mode -local map_tags = {} --- @type table Stores all protected map tags +local map_tags = {} --- @type table Stores all protected map tags Storage.register({ active_players = active_players, diff --git a/exp_scenario/module/commands/warnings.lua b/exp_scenario/module/commands/warnings.lua index bcc8c38d..14be9aad 100644 --- a/exp_scenario/module/commands/warnings.lua +++ b/exp_scenario/module/commands/warnings.lua @@ -35,7 +35,7 @@ Commands.new("get-warnings", { "exp-commands_warnings.description-get" }) local warnings = Warnings.get_warnings(player) local script_warnings = Warnings.get_script_warnings(player) local other_player_name = format_player_name(other_player) - Commands.print{ "exp-commands_warnings.player-title", other_player_name, #warnings, #script_warnings, config.temp_warning_limit } + Commands.print{ "exp-commands_warnings.player-title", other_player_name, #warnings, #script_warnings, config.script_warning_limit } for _, warning in pairs(warnings) do local by_player_name_formatted = format_player_name(warning.by_player_name) Commands.print{ "exp-commands_warnings.list-element-player", by_player_name_formatted, warning.reason } @@ -47,12 +47,12 @@ Commands.new("get-warnings", { "exp-commands_warnings.description-get" }) for player_name, player_warnings in pairs(warnings) do local player_name_formatted = format_player_name(player_name) local script_warning_count = script_warnings[player_name] and #script_warnings[player_name] or 0 - Commands.print{ "exp-commands_warnings.list-element", player_name_formatted, #player_warnings, script_warning_count, config.temp_warning_limit } + Commands.print{ "exp-commands_warnings.list-element", player_name_formatted, #player_warnings, script_warning_count, config.script_warning_limit } end for player_name, player_warnings in pairs(script_warnings) do if not warnings[player_name] then local player_name_formatted = format_player_name(player_name) - Commands.print{ "exp-commands_warnings.list-element", player_name_formatted, 0, #player_warnings, config.temp_warning_limit } + Commands.print{ "exp-commands_warnings.list-element", player_name_formatted, 0, #player_warnings, config.script_warning_limit } end end end