mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Fixed jail not working with regular #192
This commit is contained in:
@@ -1012,9 +1012,14 @@ local function auto_assign(event)
|
|||||||
local roles = Roles.config.players[player.name] or {}
|
local roles = Roles.config.players[player.name] or {}
|
||||||
|
|
||||||
local lookup = {}
|
local lookup = {}
|
||||||
for _, role in ipairs(roles) do lookup[role] = true end
|
-- Create a lookup table for existing roles, and check for block auto assign
|
||||||
|
for _, role in ipairs(roles) do
|
||||||
|
if role.block_auto_assign then return end
|
||||||
|
lookup[role] = true
|
||||||
|
end
|
||||||
|
|
||||||
local assigns, ctn = {}, 0
|
local assigns, ctn = {}, 0
|
||||||
|
-- Check roles with auto assign conditions and run the handler
|
||||||
for role, condition in pairs(Roles.config.auto_assign) do
|
for role, condition in pairs(Roles.config.auto_assign) do
|
||||||
if not lookup[role] then
|
if not lookup[role] then
|
||||||
local success, rtn = pcall(condition, player)
|
local success, rtn = pcall(condition, player)
|
||||||
@@ -1027,6 +1032,7 @@ local function auto_assign(event)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Assign new roles if any were passed
|
||||||
if ctn > 0 then Roles.assign_player(player, assigns) end
|
if ctn > 0 then Roles.assign_player(player, assigns) end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user