1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-17 23:05:07 -05:00

Fix wallmounted rotations along Y axis for 90 and 270 degree cases

This commit is contained in:
kwolekr 2013-07-08 18:50:29 -04:00
parent ce955f37ba
commit fca4610f11

View File

@ -31,6 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
static const Rotation wallmounted_to_rot[] = { static const Rotation wallmounted_to_rot[] = {
ROTATE_0, ROTATE_180, ROTATE_90, ROTATE_270 ROTATE_0, ROTATE_180, ROTATE_90, ROTATE_270
}; };
static const u8 rot_to_wallmounted[] = { static const u8 rot_to_wallmounted[] = {
2, 4, 3, 5 2, 4, 3, 5
}; };
@ -154,7 +155,7 @@ void MapNode::rotateAlongYAxis(INodeDefManager *nodemgr, Rotation rot) {
Rotation oldrot = wallmounted_to_rot[wmountface - 2]; Rotation oldrot = wallmounted_to_rot[wmountface - 2];
param2 &= ~7; param2 &= ~7;
param2 |= rot_to_wallmounted[(oldrot + rot) & 3]; param2 |= rot_to_wallmounted[(oldrot - rot) & 3];
} }
} }