diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 2243cbdf5a60b40c31ab75e251aadad6ac6eab3a..901294d6b49a85a8703cf630ae662fb2f5262a0c 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -1580,6 +1580,8 @@ void LLAgent::setAutoPilotTargetGlobal(const LLVector3d &target_global)
 		LLViewerObject *obj;
 
 		LLWorld::getInstance()->resolveStepHeightGlobal(NULL, target_global, traceEndPt, targetOnGround, groundNorm, &obj);
+		// Note: this might malfunction for sitting agent, since pelvis stays same, but agent's position becomes lower
+		// But for autopilot to work we assume that agent is standing and ready to go.
 		F64 target_height = llmax((F64)gAgentAvatarp->getPelvisToFoot(), target_global.mdV[VZ] - targetOnGround.mdV[VZ]);
 
 		// clamp z value of target to minimum height above ground
diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp
index 1fcc9a07113cd4f8f4948dc035e346bdabd68681..0ff05479f1014ef3b2fd325d74ace5b5d390bd03 100644
--- a/indra/newview/lltoolselect.cpp
+++ b/indra/newview/lltoolselect.cpp
@@ -194,7 +194,7 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi
 			{
 				LLQuaternion target_rot;
 				target_rot.shortestArc(LLVector3::x_axis, selection_dir);
-				gAgent.startAutoPilotGlobal(gAgent.getPositionGlobal(), "", &target_rot, NULL, NULL, 1.f, SELECTION_ROTATION_TRESHOLD);
+				gAgent.startAutoPilotGlobal(gAgent.getPositionGlobal(), "", &target_rot, NULL, NULL, llmax(1.f, gAgentAvatarp->getPelvisToFoot()), SELECTION_ROTATION_TRESHOLD);
 			}
 		}