game/server/npc_wretch.cpp
void CWretch::ClimbTouch( CBaseEntity *pOther )
{
	if ( pOther->IsPlayer() )
	{
		// If I hit the player, shove him aside.
		Vector vecDir = pOther->WorldSpaceCenter() - WorldSpaceCenter();
		vecDir.z = 0.0; // planar
		VectorNormalize( vecDir );

		if( IsXbox() )
		{
			vecDir *= 400.0f;
		}
		else
		{
			vecDir *= 200.0f;
		}

		pOther->VelocityPunch( vecDir );

		if ( GetActivity() != ACT_CLIMB_DISMOUNT || 
			 ( pOther->GetGroundEntity() == NULL &&
			   GetNavigator()->IsGoalActive() &&
			   pOther->GetAbsOrigin().z - GetNavigator()->GetCurWaypointPos().z < -1.0 ) )
		{
			SetCondition( COND_WRETCH_CLIMB_TOUCH );
		}

		SetTouch( NULL );
	}
	else if ( dynamic_cast<CPhysicsProp *>(pOther) )
	{
		NPCPhysics_CreateSolver( this, pOther, true, 5.0 );
	}
}
//-----------------------------------------------------------------------------
// Purpose: Lets us know if we touch the player while we're climbing.
//-----------------------------------------------------------------------------
Lets us know if we touch the player while we're climbing.
Lets us know if we touch the player while we ' re climbing .
void CWretch::ClimbTouch( CBaseEntity *pOther )
{
	if ( pOther->IsPlayer() )
	{
		Vector vecDir = pOther->WorldSpaceCenter() - WorldSpaceCenter();
		vecDir.z = 0.0; 
		VectorNormalize( vecDir );
		if( IsXbox() )
		{
			vecDir *= 400.0f;
		}
		else
		{
			vecDir *= 200.0f;
		}
		pOther->VelocityPunch( vecDir );
		if ( GetActivity() != ACT_CLIMB_DISMOUNT || 
			 ( pOther->GetGroundEntity() == NULL &&
			   GetNavigator()->IsGoalActive() &&
			   pOther->GetAbsOrigin().z - GetNavigator()->GetCurWaypointPos().z < -1.0 ) )
		{
			SetCondition( COND_WRETCH_CLIMB_TOUCH );
		}
		SetTouch( NULL );
	}
	else if ( dynamic_cast<CPhysicsProp *>(pOther) )
	{
		NPCPhysics_CreateSolver( this, pOther, true, 5.0 );
	}
}
void CWretch :: ClimbTouch ( CBaseEntity * pOther ) { if ( pOther -> IsPlayer ( ) ) { Vector vecDir = pOther -> WorldSpaceCenter ( ) - WorldSpaceCenter ( ) ; vecDir . z = 0.0 ; VectorNormalize ( vecDir ) ; if ( IsXbox ( ) ) { vecDir *= 400.0f ; } else { vecDir *= 200.0f ; } pOther -> VelocityPunch ( vecDir ) ; if ( GetActivity ( ) != ACT_CLIMB_DISMOUNT || ( pOther -> GetGroundEntity ( ) == NULL && GetNavigator ( ) -> IsGoalActive ( ) && pOther -> GetAbsOrigin ( ) . z - GetNavigator ( ) -> GetCurWaypointPos ( ) . z < -1.0 ) ) { SetCondition ( COND_WRETCH_CLIMB_TOUCH ) ; } SetTouch ( NULL ) ; } else if ( dynamic_cast < CPhysicsProp * > ( pOther ) ) { NPCPhysics_CreateSolver ( this , pOther , true , 5.0 ) ; } }
Purpose: Lets us know if we touch the player while we're climbing.
Purpose : Lets us know if we touch the player while we ' re climbing .
// If I hit the player, shove him aside. // planar