From 905464a39a644bafcf864e31fbca199a971c26ad Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Fri, 24 Jul 2015 10:42:07 +0200 Subject: [PATCH] Removed global variables (quests, throwing) --- mods/quests/central_message.lua | 2 +- mods/throwing/functions.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/quests/central_message.lua b/mods/quests/central_message.lua index ff3402e0..6a5f1bb9 100755 --- a/mods/quests/central_message.lua +++ b/mods/quests/central_message.lua @@ -1,4 +1,4 @@ -if (cmsg) then +if rawget(_G, "cmsg") then function quests.show_message(t, playername, text) if (quests.hud[playername].central_message_enabled) then local player = minetest.get_player_by_name(playername) diff --git a/mods/throwing/functions.lua b/mods/throwing/functions.lua index c3040cc0..2427c898 100755 --- a/mods/throwing/functions.lua +++ b/mods/throwing/functions.lua @@ -123,7 +123,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough recipe = craft }) - craft_width = 1 + local craft_width = 1 -- Since # isn't stable especially when there are nils in the table, count by hand for _,v in ipairs(craft) do for i,__ in ipairs(v) do @@ -132,7 +132,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough end end end - rev_craft = {} + local rev_craft = {} for i,y in ipairs(craft) do rev_craft[i] = {} for j,x in ipairs(y) do