//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool CTraceFilterLOS::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) { CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); if ( !pEntity->BlocksLOS() ) return false; return CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ); }
virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) { if ( CTraceFilterSimple::ShouldHitEntity( pHandleEntity, contentsMask ) ) { CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); if ( !pEntity ) return NULL; if ( pEntity->MyCombatCharacterPointer() || pEntity->MyCombatWeaponPointer() ) return false; // Honor BlockLOS - this lets us see through partially-broken doors, etc if ( !pEntity->BlocksLOS() ) return false; return true; } return false; }
/** Strictly checks Line of Sight only. */ static bool TraceFilterNoCombatCharacters( IHandleEntity *pServerEntity, int contentsMask ) { // Honor BlockLOS also to allow seeing through partially-broken doors CBaseEntity *entity = EntityFromEntityHandle( pServerEntity ); return ( entity->MyCombatCharacterPointer() == NULL && !entity->MyCombatWeaponPointer() && entity->BlocksLOS() ); }