game/server/shit/npc_alien_trooper.cpp
BOOL CSTrooper :: CheckRangeAttack1 ( float flDot, float flDist )
{
	if ( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire() )
	{
		TraceResult	tr;

		if ( !m_hEnemy->IsPlayer() && flDist <= 64 )
		{
			// kick nonclients, but don't shoot at them.
			return FALSE;
		}

		Vector vecSrc = GetGunPosition();

		// verify that a bullet fired from the gun will hit the enemy before the world.
		UTIL_TraceLine( vecSrc, m_hEnemy->BodyTarget(vecSrc), ignore_monsters, ignore_glass, ENT(pev), &tr);

		if ( tr.flFraction == 1.0 )
		{
			return TRUE;
		}
	}

	return FALSE;
}
//=========================================================
// CheckRangeAttack1 - overridden for STrooper, cause 
// FCanCheckAttacks() doesn't disqualify all attacks based
// on whether or not the enemy is occluded because unlike
// the base class, the STrooper can attack when the enemy is
// occluded (throw grenade over wall, etc). We must 
// disqualify the machine gun attack if the enemy is occluded.
//=========================================================
overridden for STrooper, cause
FCanCheckAttacks() doesn't disqualify all attacks based
on whether or not the enemy is occluded because unlike
the base class, the STrooper can attack when the enemy is
occluded (throw grenade over wall, etc). We must
disqualify the machine gun attack if the enemy is occluded.
overridden for STrooper cause FCanCheckAttacks () doesn ' t disqualify all attacks based on whether or not the enemy is occluded because unlike the base class the STrooper can attack when the enemy is occluded ( throw grenade over wall etc ) . We must disqualify the machine gun attack if the enemy is occluded .
BOOL CSTrooper :: CheckRangeAttack1 ( float flDot, float flDist )
{
	if ( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire() )
	{
		TraceResult	tr;
		if ( !m_hEnemy->IsPlayer() && flDist <= 64 )
		{
			return FALSE;
		}
		Vector vecSrc = GetGunPosition();
		UTIL_TraceLine( vecSrc, m_hEnemy->BodyTarget(vecSrc), ignore_monsters, ignore_glass, ENT(pev), &tr);
		if ( tr.flFraction == 1.0 )
		{
			return TRUE;
		}
	}
	return FALSE;
}
BOOL CSTrooper :: CheckRangeAttack1 ( float flDot , float flDist ) { if ( ! HasConditions ( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire ( ) ) { TraceResult tr ; if ( ! m_hEnemy -> IsPlayer ( ) && flDist <= 64 ) { return FALSE ; } Vector vecSrc = GetGunPosition ( ) ; UTIL_TraceLine ( vecSrc , m_hEnemy -> BodyTarget ( vecSrc ) , ignore_monsters , ignore_glass , ENT ( pev ) , & tr ) ; if ( tr . flFraction == 1.0 ) { return TRUE ; } } return FALSE ; }
CheckRangeAttack1 - overridden for STrooper, cause
FCanCheckAttacks() doesn't disqualify all attacks based
on whether or not the enemy is occluded because unlike
the base class, the STrooper can attack when the enemy is
occluded (throw grenade over wall, etc).
CheckRangeAttack1 - overridden for STrooper cause FCanCheckAttacks () doesn ' t disqualify all attacks based on whether or not the enemy is occluded because unlike the base class the STrooper can attack when the enemy is occluded ( throw grenade over wall etc ) .
// kick nonclients, but don't shoot at them. // verify that a bullet fired from the gun will hit the enemy before the world.