From 1f248792a5a49dd022ee2ed48858e2fb7dbdf327 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Wed, 14 Jan 2015 16:09:03 +0100 Subject: [PATCH] =?UTF-8?q?debug=20et=20am=C3=A9lioration=20de=20future=5F?= =?UTF-8?q?ban?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit debug d'une mauvaise variable ajout d'une vérification pour éviter de rebannir un joueur déja banni --- mods/future_ban/init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mods/future_ban/init.lua b/mods/future_ban/init.lua index d3854c8c..3380fbe4 100755 --- a/mods/future_ban/init.lua +++ b/mods/future_ban/init.lua @@ -26,6 +26,12 @@ minetest.register_chatcommand("future_ban", { minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list)) return end + for _,n in ipairs(future_ban_list) do + if n == param then + minetest.chat_send_player(name, param .. " is already in future ban list.") + return + end + end if not minetest.get_player_by_name(param) then table.insert(future_ban_list, param) minetest.chat_send_player(name, param .. " to future ban list added.") @@ -35,8 +41,8 @@ minetest.register_chatcommand("future_ban", { end if not minetest.ban_player(param) then table.insert(future_ban_list, param) - minetest.chat_send_player(name, desc .. " to future ban list added.") - minetest.log("action", name .. " added " .. desc .. " to future ban list.") + minetest.chat_send_player(name, param .. " to future ban list added.") + minetest.log("action", name .. " added " .. param .. " to future ban list.") save_file() else local desc = minetest.get_ban_description(param)