From: 0gb.us <0gb.us@0gb.us> Date: Wed, 16 Oct 2013 05:17:06 +0000 (-0700) Subject: Assume a selection box for fences X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=e605d7025608f8d04cdd6143c6be85e35ef067e3;p=zefram%2Fminetest%2Fminetest_engine.git Assume a selection box for fences Similar to assuming a selection box for the nodebox drawtype, minetest.register_item() now assumes a selection box for the fencelike drawtype. --- diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index bb2c62ab..aa062d73 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -106,6 +106,11 @@ function minetest.register_item(name, itemdef) -- Use the nodebox as selection box if it's not set manually if itemdef.drawtype == "nodebox" and not itemdef.selection_box then itemdef.selection_box = itemdef.node_box + elseif itemdef.drawtype == "fencelike" and not itemdef.selection_box then + itemdef.selection_box = { + type = "fixed", + fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}, + } end setmetatable(itemdef, {__index = minetest.nodedef_default}) minetest.registered_nodes[itemdef.name] = itemdef