From: Craig Robbins Date: Fri, 9 Jan 2015 05:42:03 +0000 (+1000) Subject: Fix facedir > 23 causes segfault in client X-Git-Tag: 0.4.12~123 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d576235409c1c21c25167ccd611fc847e9d23cb8;p=oweals%2Fminetest.git Fix facedir > 23 causes segfault in client See issue #2017 Applied kahrl's gist --- 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; }