forked from mtcontrib/factions
Permission bug fix
If a player does not have a rank this function will crash the game.
This commit is contained in:
parent
f75a2ea008
commit
3bbf84896c
12
factions.lua
12
factions.lua
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user