Added yaw locking to climbing navigation

This commit is contained in:
Blixibon 2021-10-18 11:27:20 -05:00
parent 1c6b0679f8
commit ade8fe0d02

View File

@ -450,6 +450,20 @@ AIMoveResult_t CAI_Motor::MoveClimbExecute( const Vector &climbDest, const Vecto
// -------------------------------------------- // --------------------------------------------
SetIdealYawAndUpdate( yaw ); SetIdealYawAndUpdate( yaw );
#ifdef MAPBASE
// Lock the yaw if we're in position
if ( UTIL_AngleMod( yaw ) == UTIL_AngleMod( GetLocalAngles().y ) )
{
SetYawLocked( true );
}
else if ( IsYawLocked() )
{
// We're in a different position now. Unlock the yaw and update it
SetYawLocked( false );
UpdateYaw( -1 );
}
#endif
return AIMR_OK; return AIMR_OK;
} }
@ -465,8 +479,7 @@ void CAI_Motor::MoveClimbStop()
GetOuter()->SetDesiredWeaponState( DESIREDWEAPONSTATE_IGNORE ); GetOuter()->SetDesiredWeaponState( DESIREDWEAPONSTATE_IGNORE );
// Unlock yaw // Unlock yaw
// TODO: Add yaw locking for when climbing is paused SetYawLocked( false );
//SetYawLocked( false );
#endif #endif
GetOuter()->RemoveFlag( FL_FLY ); GetOuter()->RemoveFlag( FL_FLY );