From 9e1e4b62844f736449ce53be7a87a769bf35d834 Mon Sep 17 00:00:00 2001
From: paramat <mat.gregory@virginmedia.com>
Date: Sun, 3 May 2015 02:44:58 +0100
Subject: [PATCH] RotateAlongYAxis: For facedir case, return if param2 >= 4

---
 src/mapnode.cpp | 3 +++
 1 file changed, 3 insertions(+)

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;
-- 
GitLab