Skip to content

Commit 2fb0e54

Browse files
kaezaPilzAdam
authored andcommittedApr 5, 2013
Use the nodebox as selection box if it's not set manually
1 parent 1a5dcfd commit 2fb0e54

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

‎builtin/misc_register.lua

+4
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ function minetest.register_item(name, itemdef)
103103

104104
-- Apply defaults and add to registered_* table
105105
if itemdef.type == "node" then
106+
-- Use the nodebox as selection box if it's not set manually
107+
if itemdef.drawtype == "nodebox" and not itemdef.selection_box then
108+
itemdef.selection_box = itemdef.node_box
109+
end
106110
setmetatable(itemdef, {__index = minetest.nodedef_default})
107111
minetest.registered_nodes[itemdef.name] = itemdef
108112
elseif itemdef.type == "craft" then

‎doc/lua_api.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,7 @@ Node definition (register_node)
15891589
damage_per_second = 0, -- If player is inside node, this damage is caused
15901590
node_box = {type="regular"}, -- See "Node boxes"
15911591
selection_box = {type="regular"}, -- See "Node boxes"
1592+
^ If drawtype "nodebox" is used and selection_box is nil, then node_box is used
15921593
legacy_facedir_simple = false, -- Support maps made in and before January 2012
15931594
legacy_wallmounted = false, -- Support maps made in and before January 2012
15941595
sounds = {

0 commit comments

Comments
 (0)
Please sign in to comment.