From d576235409c1c21c25167ccd611fc847e9d23cb8 Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Fri, 9 Jan 2015 15:42:03 +1000 Subject: [PATCH] Fix facedir > 23 causes segfault in client See issue #2017 Applied kahrl's gist --- src/mapnode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 3940c5867..056b94054 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -119,7 +119,7 @@ u8 MapNode::getFaceDir(INodeDefManager *nodemgr) const { const ContentFeatures &f = nodemgr->get(*this); if(f.param_type_2 == CPT2_FACEDIR) - return getParam2() & 0x1F; + return (getParam2() & 0x1F) % 24; return 0; } -- 2.25.1