]> git.lizzy.rs Git - xdecor.git/commitdiff
Run luacheck and fix the warnings.
authorTim <t4im@users.noreply.github.com>
Fri, 5 Aug 2016 22:00:06 +0000 (00:00 +0200)
committerTim <t4im@users.noreply.github.com>
Fri, 5 Aug 2016 22:06:17 +0000 (00:06 +0200)
.luacheckrc [new file with mode: 0644]
chess.lua
enchanting.lua
nodes.lua
rope.lua
workbench.lua

diff --git a/.luacheckrc b/.luacheckrc
new file mode 100644 (file)
index 0000000..ea47ea3
--- /dev/null
@@ -0,0 +1,9 @@
+unused_args = false
+allow_defined_top = true
+
+read_globals = {
+       "minetest",
+       "vector", "ItemStack",
+       "default",
+       "stairs", "doors", "xpanes",
+}
index baeab14a9a065c6598269bcbe81842cd2de2f031..6de09cc7f1acc1e755b2fbcdc9b8c78775204b0c 100644 (file)
--- 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").."] "..
index a3c8e5a9734f2c19cd8b8584249b9f8824319177..63641cdea58fd168e2a01ee39bd1916d580f0862 100644 (file)
@@ -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
index 83f44d6b3b0232e07c7ae90e44069b3a4dcf737a..d21584a5215cb9db19435d7aac06aa0f7ac33586 100644 (file)
--- 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(),
index d45d7f5a333305adbe57dd531cab35619168216d..189f47617a7175e62f8939759100441e8ee762f0 100644 (file)
--- 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
index 3774912cbc01aee29d9b8a465611de1241a1fdc6..ccf1918cb95f7f135174780c1b80501ae5d1f9de 100644 (file)
@@ -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