Fix facedir > 23 causes segfault in client

See issue #2017
Applied kahrl's gist
master
Craig Robbins 2015-01-09 15:42:03 +10:00
parent 7ad17a25f4
commit d576235409
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ u8 MapNode::getFaceDir(INodeDefManager *nodemgr) const
{ {
const ContentFeatures &f = nodemgr->get(*this); const ContentFeatures &f = nodemgr->get(*this);
if(f.param_type_2 == CPT2_FACEDIR) if(f.param_type_2 == CPT2_FACEDIR)
return getParam2() & 0x1F; return (getParam2() & 0x1F) % 24;
return 0; return 0;
} }