From: Diego Martínez Date: Fri, 5 Apr 2013 05:51:31 +0000 (-0300) Subject: Use the nodebox as selection box if it's not set manually X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=2fb0e547a01a6e61b821737e61315bad3312e41e;p=zefram%2Fminetest%2Fminetest_engine.git Use the nodebox as selection box if it's not set manually --- diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index f9c06a02..d1e28fda 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -103,6 +103,10 @@ function minetest.register_item(name, itemdef) -- Apply defaults and add to registered_* table if itemdef.type == "node" then + -- 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 + end setmetatable(itemdef, {__index = minetest.nodedef_default}) minetest.registered_nodes[itemdef.name] = itemdef elseif itemdef.type == "craft" then diff --git a/doc/lua_api.txt b/doc/lua_api.txt index a61ffce6..de73ecd3 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1589,6 +1589,7 @@ Node definition (register_node) damage_per_second = 0, -- If player is inside node, this damage is caused node_box = {type="regular"}, -- See "Node boxes" selection_box = {type="regular"}, -- See "Node boxes" + ^ If drawtype "nodebox" is used and selection_box is nil, then node_box is used legacy_facedir_simple = false, -- Support maps made in and before January 2012 legacy_wallmounted = false, -- Support maps made in and before January 2012 sounds = {