bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) { CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity ); if ( !pEntity ) return false; // Check parents against each other // NOTE: Don't let siblings/parents collide. if ( UTIL_EntityHasMatchingRootParent( m_pRootParent, pEntity ) ) return false; if ( m_checkHash ) { if ( g_EntityCollisionHash->IsObjectPairInHash( m_pEntity, pEntity ) ) return false; } #ifndef CLIENT_DLL if ( m_pEntity->IsNPC() ) { if ( NPC_CheckBrushExclude( m_pEntity, pEntity ) ) return false; } #endif return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask ); }
static int luasrc_UTIL_EntityHasMatchingRootParent (lua_State *L) { lua_pushboolean(L, UTIL_EntityHasMatchingRootParent(luaL_checkentity(L, 1), luaL_checkentity(L, 2))); return 1; }