summaryrefslogtreecommitdiff
path: root/src/mapnode.cpp
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2015-05-03 02:44:58 +0100
committerparamat <mat.gregory@virginmedia.com>2015-05-03 03:43:51 +0100
commit9e1e4b62844f736449ce53be7a87a769bf35d834 (patch)
treea9830ba1f00e342dfc3c43f505da23a03c44f16b /src/mapnode.cpp
parentaef1b41b021a41a85ddd83d9ba33cfe9abc0b19d (diff)
downloadminetest-9e1e4b62844f736449ce53be7a87a769bf35d834.tar.gz
minetest-9e1e4b62844f736449ce53be7a87a769bf35d834.tar.bz2
minetest-9e1e4b62844f736449ce53be7a87a769bf35d834.zip
RotateAlongYAxis: For facedir case, return if param2 >= 4
Diffstat (limited to 'src/mapnode.cpp')
-rw-r--r--src/mapnode.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mapnode.cpp b/src/mapnode.cpp
index 4afa91983..fe9686f0d 100644
--- a/src/mapnode.cpp
+++ b/src/mapnode.cpp
@@ -163,6 +163,9 @@ void MapNode::rotateAlongYAxis(INodeDefManager *nodemgr, Rotation rot) {
ContentParamType2 cpt2 = nodemgr->get(*this).param_type_2;
if (cpt2 == CPT2_FACEDIR) {
+ if (param2 >= 4)
+ return;
+
u8 newrot = param2 & 3;
param2 &= ~3;
param2 |= (newrot + rot) & 3;