mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Make the @as casts actually apply
emmylua only parses the inline cast as `--[[@as T]]`, the spaced form `--[[ @as T ]]` is treated as a plain comment, so all 149 of them were doing nothing. LuaGuiElement.style is a union because a style name can be assigned to it, so reading it back needs the cast. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -284,7 +284,7 @@ local server_role = setmetatable({
|
||||
--- @param player LuaPlayer | string | nil
|
||||
--- @return ExpRoles.Role[]
|
||||
function ExpRoles.get_player_roles(player)
|
||||
local player_name = type(player) == "table" and player.name or player --[[ @as string? ]]
|
||||
local player_name = type(player) == "table" and player.name or player --[[@as string?]]
|
||||
-- The server is not a player and is allowed to do anything
|
||||
if player_name == nil then return { server_role } end
|
||||
|
||||
@@ -678,7 +678,7 @@ end
|
||||
--- @param silent boolean?
|
||||
--- @param sync boolean
|
||||
local function change_player_roles(player, roles, change_type, by_player_name, silent, sync)
|
||||
local player_name = type(player) == "table" and player.name or player --[[ @as string? ]]
|
||||
local player_name = type(player) == "table" and player.name or player --[[@as string?]]
|
||||
if not player_name then return end
|
||||
|
||||
local role_objects = resolve_roles(roles)
|
||||
|
||||
Reference in New Issue
Block a user