Fixed an issue when trying to get out of water.

This commit is contained in:
hlstriker 2013-11-03 07:48:55 +00:00 committed by squeek
parent 88e40d9bc9
commit df82d96409

View file

@ -2080,26 +2080,19 @@ void CGameMovement::FullWalkMove( )
TryPlayerMove(); TryPlayerMove();
// See if we are still in water? // See if we are still in water?
CheckWater(); CheckWater();
// FF --> hlstriker: Make sure player isn't swimming before we return
if( player->GetWaterLevel() < WL_Waist )
{
player->m_flWaterJumpTime = 0;
return;
}
// FF <--
} }
// If we are swimming in the water, see if we are nudging against a place we can jump up out // If we are swimming in the water, see if we are nudging against a place we can jump up out
// of, and, if so, start out jump. Otherwise, if we are not moving up, then reset jump timer to 0 // of, and, if so, start out jump. Otherwise, if we are not moving up, then reset jump timer to 0
if ( player->GetWaterLevel() >= WL_Waist ) if ( player->GetWaterLevel() >= WL_Waist )
{ {
if ( player->GetWaterLevel() == WL_Waist ) if ( player->GetWaterLevel() == WL_Waist
&& mv->m_vecVelocity[2] > 0 ) // FF --> hlstriker: Make sure the player is actually moving upwards before trying to jump out of water.
{ {
CheckWaterJump(); CheckWaterJump();
} }
// If we are falling again, then we must not trying to jump out of water any more. // If we are falling again, then we must not trying to jump out of water any more.
if ( mv->m_vecVelocity[2] < 0 && if ( mv->m_vecVelocity[2] < 0 &&
player->m_flWaterJumpTime ) player->m_flWaterJumpTime )
{ {