View Single Post
AlexALX
Senior Member
Join Date: Apr 2009
Old 09-08-2010 , 18:24   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #171

Quote:
int UTIL_EntitiesInBox( CBaseEntity **pList, int listMax, const Vector &mins, const Vector &maxs, int flagMask )
{
edict_t *pEdict = g_engfuncs.pfnPEntityOfEntIndex( 1 );
CBaseEntity *pEntity;
int count;

count = 0;

if ( !pEdict )
return count;

for ( int i = 1; i < gpGlobals->maxEntities; i++, pEdict++ )
{
if ( pEdict->free ) // Not in use
continue;

if ( flagMask && !(pEdict->v.flags & flagMask) ) // Does it meet the criteria?
continue;

if ( mins.x > pEdict->v.absmax.x ||
mins.y > pEdict->v.absmax.y ||
mins.z > pEdict->v.absmax.z ||
maxs.x < pEdict->v.absmin.x ||
maxs.y < pEdict->v.absmin.y ||
maxs.z < pEdict->v.absmin.z )
continue;

pEntity = CBaseEntity::Instance(pEdict);
if ( !pEntity )
continue;

pList[ count ] = pEntity;
count++;

if ( count >= listMax )
return count;
}

return count;
}
What is this?

Last edited by AlexALX; 09-08-2010 at 18:31.
AlexALX is offline