Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Teams not Showing Up in Sandbox #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions openpermissions/lua/openpermissions/cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,13 @@ function OpenPermissions:OpenMenu(specific_addon)
end
else
local teams = {}
for i,t in ipairs(team.GetAllTeams()) do
for i,t in pairs(team.GetAllTeams()) do
table.insert(teams, {Name = t.Name, Index = i, Color = t.Color})
end
table.SortByMember(teams, "Name", true)
for i,item in ipairs(teams) do
DMenuOption_ColorIcon(ACCESS_GROUP_TEAM:AddOption(item.Name, function()
AddAccessGroup:Add(OpenPermissions.ACCESS_GROUP.TEAM, item.Name, OpenPermissions:GetTeamIdentifier(i))
AddAccessGroup:Add(OpenPermissions.ACCESS_GROUP.TEAM, item.Name, OpenPermissions:GetTeamIdentifier(item.Index))
end), item.Color)
end
end
Expand Down Expand Up @@ -986,4 +986,4 @@ end)

net.Receive("OpenPermissions.NotAnAddon", function()
OpenPermissions:ChatPrint(L"not_an_addon", "[ERROR]", OpenPermissions.COLOR_RED)
end)
end)
4 changes: 2 additions & 2 deletions openpermissions/lua/openpermissions/sh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ function OpenPermissions:GetTeamFromIdentifier(team_identifier)
end
end
else
for i,t in ipairs(team.GetAllTeams()) do
for i,t in pairs(team.GetAllTeams()) do
if (t.Name == team_identifier) then
team_identifier_index[team_identifier] = i
return i
Expand Down Expand Up @@ -685,4 +685,4 @@ else
net.SendToServer()
end)
end
end
end