From a2b7ebc6f25524fb31cdad096c56064be1f3ad77 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 6 Aug 2016 00:00:06 +0200 Subject: [PATCH] Run luacheck and fix the warnings. --- .luacheckrc | 9 +++++++++ chess.lua | 4 ++-- enchanting.lua | 1 - nodes.lua | 1 - rope.lua | 4 +--- workbench.lua | 3 ++- 6 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 .luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..ea47ea3 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,9 @@ +unused_args = false +allow_defined_top = true + +read_globals = { + "minetest", + "vector", "ItemStack", + "default", + "stairs", "doors", "xpanes", +} diff --git a/chess.lua b/chess.lua index baeab14..6de09cc 100644 --- a/chess.lua +++ b/chess.lua @@ -504,9 +504,9 @@ function realchess.move(pos, from_list, from_index, to_list, to_index, _, player meta:set_string("playerWhite", playerWhite) meta:set_string("playerBlack", playerBlack) - meta:set_string("lastMove", thisMove) + lastMove = thisMove + meta:set_string("lastMove", lastMove) meta:set_int("lastMoveTime", minetest.get_gametime()) - local lastMove = meta:get_string("lastMove") if lastMove == "black" then minetest.chat_send_player(playerWhite, "["..os.date("%H:%M:%S").."] ".. diff --git a/enchanting.lua b/enchanting.lua index a3c8e5a..63641cd 100644 --- a/enchanting.lua +++ b/enchanting.lua @@ -127,7 +127,6 @@ function enchanting.destruct(pos) end function enchanting.timer(pos) - local node = minetest.get_node(pos) local num = #minetest.get_objects_inside_radius(pos, 0.9) if num == 0 then diff --git a/nodes.lua b/nodes.lua index 83f44d6..d21584a 100644 --- a/nodes.lua +++ b/nodes.lua @@ -354,7 +354,6 @@ xdecor.register("painting_1", { inventory_image = "xdecor_painting_empty.png", wield_image = "xdecor_painting_empty.png", paramtype2 = "wallmounted", - wield_image = "xdecor_painting_empty.png", sunlight_propagates = true, groups = {choppy=3, oddly_breakable_by_hand=2, flammable=2, attached_node=1}, sounds = default.node_sound_wood_defaults(), diff --git a/rope.lua b/rope.lua index d45d7f5..189f476 100644 --- a/rope.lua +++ b/rope.lua @@ -9,9 +9,7 @@ end) function rope.place(itemstack, placer, pointed_thing) if pointed_thing.type == "node" then - local under = pointed_thing.under - local above = pointed_thing.above - local pos = above + local pos = pointed_thing.above local oldnode = minetest.get_node(pos) local stackname = itemstack:get_name() if minetest.is_protected(pos, placer:get_player_name()) then return end diff --git a/workbench.lua b/workbench.lua index 3774912..ccf1918 100644 --- a/workbench.lua +++ b/workbench.lua @@ -229,7 +229,8 @@ for i = 1, #nodes do local def = minetest.registered_nodes[node] if d[3] then - local groups, tiles = {}, {} + local groups = {} + local tiles groups.not_in_creative_inventory = 1 for k, v in pairs(def.groups) do