diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 759416a5a1b7f9488677ebe8dfb50bf0b13e1320..c2d5479cb91b7343add40a8cf8bea06ef4d5cc2b 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -2190,7 +2190,7 @@ void LLToolPie::steerCameraWithMouse(S32 x, S32 y)
 	{
 		old_yaw_angle = F_PI_BY_TWO + asinf(pick_distance_from_rotation_center / camera_distance_from_rotation_center);
 
-		if (mouse_ray * rotation_frame.getLeftAxis() < 0.f)
+		if (old_mouse_ray * rotation_frame.getLeftAxis() < 0.f)
 		{
 			old_yaw_angle *= -1.f;
 		}