diff options
author | Craig Robbins <kde.psych@gmail.com> | 2015-01-09 15:42:03 +1000 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2015-01-09 15:42:03 +1000 |
commit | d576235409c1c21c25167ccd611fc847e9d23cb8 (patch) | |
tree | 6788643f799ac06b23ba15df6f7275ccbdce45dc | |
parent | 7ad17a25f4dfc81427df54d5c855b40b4472d517 (diff) | |
download | minetest-d576235409c1c21c25167ccd611fc847e9d23cb8.tar.gz minetest-d576235409c1c21c25167ccd611fc847e9d23cb8.tar.bz2 minetest-d576235409c1c21c25167ccd611fc847e9d23cb8.zip |
Fix facedir > 23 causes segfault in client
See issue #2017
Applied kahrl's gist
-rw-r--r-- | src/mapnode.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |