From a1c6e89273ce9a46b49421c739e2205d957cfb17 Mon Sep 17 00:00:00 2001 From: Jonathan Fabian Date: Thu, 4 Dec 2014 23:25:46 -0500 Subject: Fix duplicate commands added to README.md --- MCServer/Plugins/InfoDump.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'MCServer/Plugins') 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: -- cgit v1.2.3