RotateAlongYAxis: For facedir case, return if param2 >= 4

This commit is contained in:
paramat 2015-05-03 02:44:58 +01:00
parent aef1b41b02
commit 9e1e4b6284

@ -163,6 +163,9 @@ void MapNode::rotateAlongYAxis(INodeDefManager *nodemgr, Rotation rot) {
ContentParamType2 cpt2 = nodemgr->get(*this).param_type_2; ContentParamType2 cpt2 = nodemgr->get(*this).param_type_2;
if (cpt2 == CPT2_FACEDIR) { if (cpt2 == CPT2_FACEDIR) {
if (param2 >= 4)
return;
u8 newrot = param2 & 3; u8 newrot = param2 & 3;
param2 &= ~3; param2 &= ~3;
param2 |= (newrot + rot) & 3; param2 |= (newrot + rot) & 3;