RotateAlongYAxis: For facedir case, return if param2 >= 4
authorparamat <mat.gregory@virginmedia.com>
Sun, 3 May 2015 01:44:58 +0000 (02:44 +0100)
committerparamat <mat.gregory@virginmedia.com>
Sun, 3 May 2015 02:43:51 +0000 (03:43 +0100)
src/mapnode.cpp

index 4afa91983b19917b8f2db9d7888f7838ce45dc52..fe9686f0d3f0fe07e583164cdeb07a012029fd71 100644 (file)
@@ -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;