Fix issues with util and commands

- Use rawget when testing for locale strings
- Use player index 0 for errors in rcon commands
This commit is contained in:
Cooldude2606
2025-01-11 00:38:24 +00:00
parent 6b0949047e
commit 3e6ec6a867
2 changed files with 3 additions and 3 deletions

View File

@@ -565,7 +565,7 @@ function Commands._prototype:register(callback)
local success, traceback = xpcall(Commands._event_handler, debug.traceback, event)
--- @cast traceback string
if not success and not traceback:find("Command does not support rcon usage") then
local key = "<" .. table.concat({ event.name, event.player_index, event.tick }, ":") .. ">"
local key = "<" .. table.concat({ event.name, event.player_index or 0, event.tick }, ":") .. ">"
local _, msg = Commands.status.internal_error(key)
Commands.error(msg)
log("Internal Command Error " .. key .. "\n" .. traceback)