diff --git a/ClassicalSharp/Blocks/AutoRotate.cs b/ClassicalSharp/Blocks/AutoRotate.cs index ef975c32c..b295047a9 100644 --- a/ClassicalSharp/Blocks/AutoRotate.cs +++ b/ClassicalSharp/Blocks/AutoRotate.cs @@ -26,7 +26,7 @@ namespace ClassicalSharp { return RotateDirection(game, block, name, offset); } else if (Utils.CaselessEquals(dir, "UD") || Utils.CaselessEquals(dir, "WE") || Utils.CaselessEquals(dir, "NS")) { - return RotatePillar(game, block, name, offset); + return RotateOther(game, block, name, offset); } return block; } @@ -49,20 +49,22 @@ namespace ClassicalSharp { return Find(game, block, name + height); } - static byte RotatePillar(Game game, byte block, string name, Vector3 offset) { + static byte RotateOther(Game game, byte block, string name, Vector3 offset) { + // Fence type blocks if (game.BlockInfo.FindID(name + "-UD") == -1) { float yaw = game.LocalPlayer.HeadYawDegrees; if (yaw < 0) yaw += 360; - if (yaw < 45 || (yaw >= 135 && yaw < 225) || yaw > 315) { + + if (yaw < 45 || (yaw >= 135 && yaw < 225) || yaw > 315) return Find(game, block, name + "-WE"); - } else { - return Find(game, block, name + "-NS"); - } + return Find(game, block, name + "-NS"); } + + // Thin pillar type blocks BlockFace face = game.SelectedPos.BlockFace; if (face == BlockFace.YMax || face == BlockFace.YMin) return Find(game, block, name + "-UD"); - if (face == BlockFace.XMax || face == BlockFace.XMin) + if (face == BlockFace.XMax || face == BlockFace.XMin) return Find(game, block, name + "-WE"); if (face == BlockFace.ZMax || face == BlockFace.ZMin) return Find(game, block, name + "-NS");