Use the nodebox as selection box if it's not set manually

This commit is contained in:
Diego Martínez 2013-04-05 02:51:31 -03:00 committed by Nils Dagsson Moskopp
parent de38f0be50
commit 6dfa35ea48
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 4 additions and 0 deletions

View File

@ -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