mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Type the last of the forward declarations
Locals declared ahead of an assignment inside a callback were inferred as nil at every use site. The role event handlers are given a class so the table is not unified with the other module handler tables. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
-- @config Warnings
|
||||
|
||||
return {
|
||||
--- @type (LocalisedString[] | fun(player: LuaPlayer, by_player_name: string, number_of_warnings: number))[]
|
||||
actions = { --- @setting actions what actions are taking at number of warnings
|
||||
-- if a localized string is used then __1__ will by_player_name and __2__ will be the current warning count (auto inserted)
|
||||
{ "warnings.received", "" },
|
||||
|
||||
@@ -1115,8 +1115,9 @@ local function role_update(event)
|
||||
-- Updates the players permission group
|
||||
local highest = Roles.get_player_highest_role(player)
|
||||
if highest.permission_group then
|
||||
if highest.permission_group[1] then
|
||||
local group = game.permissions.get_group(highest.permission_group[2])
|
||||
local permission_group = highest.permission_group --[[@as [boolean, string] ]]
|
||||
if permission_group[1] then
|
||||
local group = game.permissions.get_group(permission_group[2])
|
||||
if group then
|
||||
Groups.add_to_permission_group_async(group, player)
|
||||
end
|
||||
|
||||
@@ -107,7 +107,7 @@ function Warnings.add_warning(player, by_player_name, reason)
|
||||
|
||||
reason = reason or "None given."
|
||||
|
||||
local warning_count
|
||||
local warning_count --- @type number
|
||||
PlayerWarnings:update(player.name, function(_, warnings)
|
||||
local warning = {
|
||||
by_player_name = by_player_name,
|
||||
|
||||
Reference in New Issue
Block a user