From 37b4f0d34c73de58e0f5d153b7e699dc7430e23d Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 3 Mar 2016 23:18:04 -0800 Subject: 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. --- src/content_mapblock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/content_mapblock.cpp') diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index c2934f26a..6a83bd8f3 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -167,7 +167,7 @@ static inline void getNeighborConnectingFace(v3s16 p, INodeDefManager *nodedef, MeshMakeData *data, MapNode n, int v, int *neighbors) { MapNode n2 = data->m_vmanip.getNodeNoEx(p); - if (nodedef->nodeboxConnects(n, n2)) + if (nodedef->nodeboxConnects(n, n2, v)) *neighbors |= v; } -- cgit v1.2.3