Exemplo n.º 1
0
//-----------------------------------------------------------------------------
// Purpose: Finish ducking
//-----------------------------------------------------------------------------
void CHL2GameMovement::FinishDuck(void)
{
	Vector hullSizeNormal = VEC_HULL_MAX - VEC_HULL_MIN;
	Vector hullSizeCrouch = VEC_DUCK_HULL_MAX - VEC_DUCK_HULL_MIN;

	Vector viewDelta = 0.5f * (hullSizeNormal - hullSizeCrouch);

	player->SetViewOffset(GetPlayerViewOffset(true));
	player->AddFlag(FL_DUCKING);
	player->m_Local.m_bDucking = false;

	if (!player->m_Local.m_bDucked)
	{

		Vector org = mv->GetAbsOrigin();

		if (player->GetGroundEntity() != NULL)
		{
			org -= VEC_DUCK_HULL_MIN - VEC_HULL_MIN;
		}
		else
		{
			org += viewDelta;
		}
		mv->SetAbsOrigin(org);

		player->m_Local.m_bDucked = true;
	}

	// See if we are stuck?
	FixPlayerCrouchStuck(true);

	// Recategorize position since ducking can change origin
	CategorizePosition();
}
Exemplo n.º 2
0
void CSDKGameMovement::FinishProne( void )
{	
	m_pSDKPlayer->m_Shared.SetProne( true );
	m_pSDKPlayer->m_Shared.m_flGoProneTime = 0.0f;

	FinishUnDuck();	// clear ducking

	SetProneEyeOffset( 1.0 );

	FixPlayerCrouchStuck(true);

	CategorizePosition();
}