Move autoPilot Agent Avatar Valid check to beginning

This commit is contained in:
Liru Færs
2020-01-10 02:42:48 -05:00
parent 8e57288819
commit e15839a2cb

View File

@@ -1754,7 +1754,7 @@ void LLAgent::stopAutoPilot(BOOL user_cancel)
//-----------------------------------------------------------------------------
void LLAgent::autoPilot(F32 *delta_yaw)
{
if (mAutoPilot)
if (mAutoPilot && isAgentAvatarValid())
{
bool follow = !mLeaderID.isNull(); //mAutoPilotBehaviorName == "Follow";
if (follow)
@@ -1779,8 +1779,6 @@ void LLAgent::autoPilot(F32 *delta_yaw)
// Should we fly if the height difference is great enough here? Altitude is often invalid...
}
}
if (!isAgentAvatarValid()) return;
if (!follow && gAgentAvatarp->mInAir && mAutoPilotAllowFlying)
{