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:
@@ -200,7 +200,7 @@ function Roles.debug()
|
|||||||
local output = ""
|
local output = ""
|
||||||
for index, role_name in ipairs(Roles.config.order) do
|
for index, role_name in ipairs(Roles.config.order) do
|
||||||
local role = Roles.config.roles[role_name]
|
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)
|
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))
|
output = output .. string.format("\n%s %s) %s[/color]", color_str, index, serpent.line(role))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ local Storage = require("modules/exp_util/storage")
|
|||||||
|
|
||||||
--- Storage variables
|
--- Storage variables
|
||||||
local active_players = {} --- @type table<number, boolean> Stores all players in in protected mode
|
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({
|
Storage.register({
|
||||||
active_players = active_players,
|
active_players = active_players,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ Commands.new("get-warnings", { "exp-commands_warnings.description-get" })
|
|||||||
local warnings = Warnings.get_warnings(player)
|
local warnings = Warnings.get_warnings(player)
|
||||||
local script_warnings = Warnings.get_script_warnings(player)
|
local script_warnings = Warnings.get_script_warnings(player)
|
||||||
local other_player_name = format_player_name(other_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
|
for _, warning in pairs(warnings) do
|
||||||
local by_player_name_formatted = format_player_name(warning.by_player_name)
|
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 }
|
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
|
for player_name, player_warnings in pairs(warnings) do
|
||||||
local player_name_formatted = format_player_name(player_name)
|
local player_name_formatted = format_player_name(player_name)
|
||||||
local script_warning_count = script_warnings[player_name] and #script_warnings[player_name] or 0
|
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
|
end
|
||||||
for player_name, player_warnings in pairs(script_warnings) do
|
for player_name, player_warnings in pairs(script_warnings) do
|
||||||
if not warnings[player_name] then
|
if not warnings[player_name] then
|
||||||
local player_name_formatted = format_player_name(player_name)
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user