File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,34 +21,28 @@ local function syncTags(source)
2121
2222 local rolesAllowed = {}
2323 local highestRole , highestRoleIndex = nil , nil
24+ local roles = nil
25+
26+ if indetifiers .discord then
27+ roles = getRoles (source )
28+ end
2429
2530 for i = 1 , # RoleList do
2631 if tostring (RoleList [i ][1 ]) == " 0" then
2732 insert (rolesAllowed , i )
2833 highestRoleIndex = i
2934 end
30- end
3135
32- if not identifiers .discord then -- If the player doesn't have a discord identifier, we'll just assign the default role, if it exists.
33- cachedPlayerRoles [source ] = rolesAllowed
34- playerSelectedRole [source ] = RoleList [highestRoleIndex ][2 ]
35- return
36- end
37-
38- local roles = getRoles (source )
39- if roles == nil then goto skip end
40-
41- for i = 1 , # RoleList do
36+ if roles == nil then goto skip end
4237 for _ , v in pairs (roles ) do
4338 if tostring (RoleList [i ][1 ]) == tostring (v ) then
4439 insert (rolesAllowed , i )
4540 highestRole , highestRoleIndex = v , i
4641 end
4742 end
43+ :: skip::
4844 end
4945
50- :: skip::
51-
5246 cachedPlayerRoles [source ] = rolesAllowed
5347 playerSelectedRole [source ] = RoleList [highestRoleIndex ][2 ]
5448end
You can’t perform that action at this time.
0 commit comments