summaryrefslogtreecommitdiff
path: root/src/nodedef.h
diff options
context:
space:
mode:
authorAuke Kok <sofar@foo-projects.org>2016-03-03 23:18:04 -0800
committerShadowNinja <shadowninja@minetest.net>2016-03-12 12:08:17 -0500
commit37b4f0d34c73de58e0f5d153b7e699dc7430e23d (patch)
tree5c1f23df722ef9bc2c1110d78016439b26b35772 /src/nodedef.h
parente737b1c271c9d957651ef2201bb820e4465358bf (diff)
downloadminetest-37b4f0d34c73de58e0f5d153b7e699dc7430e23d.tar.gz
minetest-37b4f0d34c73de58e0f5d153b7e699dc7430e23d.tar.bz2
minetest-37b4f0d34c73de58e0f5d153b7e699dc7430e23d.zip
Allow nodes to specify which sides to connect to.
NDT_CONNECTED attempts to connect to any side of nodes that it can connect to, which is troublesome for FACEDIR type nodes that generally may only have one usable face, and can be rotated. We introduce a node parameter `connect_sides` that is valid for any node type. If specified, it lists faces of the node (in "top", "bottom", "front", "left", "back", "right", form, as array) that connecting nodeboxes can connect to. "front" corresponds to the south facing side of a node with facedir = 0. If the node is rotatable using *simple* FACEDIR, then the attached face is properly rotated before checking. This allows e.g. a chest to be attached to only from the rear side.
Diffstat (limited to 'src/nodedef.h')
-rw-r--r--src/nodedef.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nodedef.h b/src/nodedef.h
index f92a3a941..58d0faffa 100644
--- a/src/nodedef.h
+++ b/src/nodedef.h
@@ -271,6 +271,8 @@ struct ContentFeatures
bool legacy_facedir_simple;
// Set to true if wall_mounted used to be set to true
bool legacy_wallmounted;
+ // for NDT_CONNECTED pairing
+ u8 connect_sides;
// Sound properties
SimpleSoundSpec sound_footstep;
@@ -325,7 +327,7 @@ public:
virtual void pendNodeResolve(NodeResolver *nr)=0;
virtual bool cancelNodeResolveCallback(NodeResolver *nr)=0;
- virtual bool nodeboxConnects(const MapNode from, const MapNode to)=0;
+ virtual bool nodeboxConnects(const MapNode from, const MapNode to, u8 connect_face)=0;
};
class IWritableNodeDefManager : public INodeDefManager {