summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/InfoDump.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-05 08:09:56 +0100
committerMattes D <github@xoft.cz>2014-12-05 08:09:56 +0100
commitad13a80d1459f3cde7969fecc5704608ab597580 (patch)
treee85177902c0d72b320248f4e91d4f702967960d0 /MCServer/Plugins/InfoDump.lua
parentMerge pull request #1648 from mc-server/CraftingLuaFix (diff)
parentFix duplicate commands added to README.md (diff)
downloadcuberite-ad13a80d1459f3cde7969fecc5704608ab597580.tar
cuberite-ad13a80d1459f3cde7969fecc5704608ab597580.tar.gz
cuberite-ad13a80d1459f3cde7969fecc5704608ab597580.tar.bz2
cuberite-ad13a80d1459f3cde7969fecc5704608ab597580.tar.lz
cuberite-ad13a80d1459f3cde7969fecc5704608ab597580.tar.xz
cuberite-ad13a80d1459f3cde7969fecc5704608ab597580.tar.zst
cuberite-ad13a80d1459f3cde7969fecc5704608ab597580.zip
Diffstat (limited to 'MCServer/Plugins/InfoDump.lua')
-rw-r--r--MCServer/Plugins/InfoDump.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/MCServer/Plugins/InfoDump.lua b/MCServer/Plugins/InfoDump.lua
index de1d1f451..07a534b88 100644
--- a/MCServer/Plugins/InfoDump.lua
+++ b/MCServer/Plugins/InfoDump.lua
@@ -444,7 +444,18 @@ local function BuildPermissions(a_PluginInfo)
Permissions[info.Permission] = Permission
-- Add the command to the list of commands using this permission:
Permission.CommandsAffected = Permission.CommandsAffected or {}
- table.insert(Permission.CommandsAffected, CommandString)
+ -- First, make sure that we don't already have this command in the list,
+ -- it may have already been present in a_PluginInfo
+ local NewCommand = true
+ for _, existCmd in ipairs(Permission.CommandsAffected) do
+ if CommandString == existCmd then
+ NewCommand = false
+ break
+ end
+ end
+ if NewCommand then
+ table.insert(Permission.CommandsAffected, CommandString)
+ end
end
-- Process the command param combinations for permissions: