Permission bug fix

If a player does not have a rank this function will crash the game.
This commit is contained in:
Coder12a 2018-10-27 14:01:49 -05:00
parent f75a2ea008
commit 3bbf84896c
1 changed files with 7 additions and 5 deletions

View File

@ -409,11 +409,13 @@ function factions.Faction.has_permission(self, player, permission)
return false
end
local perms = self.ranks[p]
for i in ipairs(perms) do
if perms[i] == permission then
return true
end
end
if perms then
for i in ipairs(perms) do
if perms[i] == permission then
return true
end
end
end
return false
end