]> git.lizzy.rs Git - signs_lib.git/commitdiff
fix incorrect "onpole" activation when placing on top/bottom of post
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>
Wed, 11 Sep 2019 19:17:19 +0000 (15:17 -0400)
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>
Wed, 11 Sep 2019 19:17:19 +0000 (15:17 -0400)
api.lua

diff --git a/api.lua b/api.lua
index 80e545b6d243af42901c942d311f2d2685913bc5..5a14a74175b20987297fc284b383d35dcafc1f08 100644 (file)
--- a/api.lua
+++ b/api.lua
@@ -579,13 +579,20 @@ function signs_lib.check_for_pole(pos, pointed_thing)
        local pnode = minetest.get_node(ppos)
        local pdef = minetest.registered_items[pnode.name]
 
-       if signs_lib.allowed_poles[pnode.name]
+       print(dump(pos))
+       print(dump(ppos))
+
+       if (signs_lib.allowed_poles[pnode.name]
                  or (pdef and pdef.drawtype == "fencelike")
                  or string.find(pnode.name, "default:fence_")
                  or string.find(pnode.name, "_post")
                  or string.find(pnode.name, "fencepost")
                  or (pnode.name == "streets:bigpole" and pnode.param2 < 4)
-                 or (pnode.name == "streets:bigpole" and pnode.param2 > 19 and pnode.param2 < 24) then
+                 or (pnode.name == "streets:bigpole" and pnode.param2 > 19 and pnode.param2 < 24)
+               )
+         and
+               (pos.x ~= ppos.x or pos.z ~= ppos.z) then
+               print("signs_lib.check_for_pole returned true")
                return true
        end
 end