mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
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) <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ local Storage = require("modules/exp_util/storage")
|
||||
|
||||
--- Storage variables
|
||||
local active_players = {} --- @type table<number, boolean> Stores all players in in protected mode
|
||||
local map_tags = {} --- @type table<number, boolean> Stores all protected map tags
|
||||
local map_tags = {} --- @type table<string, boolean> Stores all protected map tags
|
||||
|
||||
Storage.register({
|
||||
active_players = active_players,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user