diff options
Diffstat (limited to 'src/mapnode.cpp')
-rw-r--r-- | src/mapnode.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mapnode.cpp b/src/mapnode.cpp index c46719a68..9d3459173 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -26,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" // For ser_ver_supported #include "util/serialize.h" #include "log.h" +#include "util/directiontables.h" #include "util/numeric.h" #include <string> #include <sstream> @@ -152,12 +153,15 @@ bool MapNode::getLightBanks(u8 &lightday, u8 &lightnight, INodeDefManager *nodem return f.param_type == CPT_LIGHT || f.light_source != 0; } -u8 MapNode::getFaceDir(INodeDefManager *nodemgr) const +u8 MapNode::getFaceDir(INodeDefManager *nodemgr, bool allow_wallmounted) const { const ContentFeatures &f = nodemgr->get(*this); if (f.param_type_2 == CPT2_FACEDIR || f.param_type_2 == CPT2_COLORED_FACEDIR) return (getParam2() & 0x1F) % 24; + if (allow_wallmounted && (f.param_type_2 == CPT2_WALLMOUNTED || + f.param_type_2 == CPT2_COLORED_WALLMOUNTED)) + return wallmounted_to_facedir[getParam2() & 0x07]; return 0; } @@ -246,7 +250,7 @@ void transformNodeBox(const MapNode &n, const NodeBox &nodebox, if (nodebox.type == NODEBOX_FIXED || nodebox.type == NODEBOX_LEVELED) { const std::vector<aabb3f> &fixed = nodebox.fixed; - int facedir = n.getFaceDir(nodemgr); + int facedir = n.getFaceDir(nodemgr, true); u8 axisdir = facedir>>2; facedir&=0x03; for (aabb3f box : fixed) { |