This is my first tutorial.
After interpreting trigger.cpp (from HLDS), I decided to make this tutorial.
EngFunc_EntitiesInPVS (maybe the same for
EngFunc_FindClientInPVS)
It returns an entity in PVS (potential visible set) of a player.
It never returns worldspawn.
In that entity returned, you have a set of chained entities using pev_chain.
Example
Code:
public whatisonPVS(id)
{
static next, chain;
static class[32];
next = engfunc(EngFunc_EntitiesInPVS, id);
while(next)
{
pev(next, pev_classname, class, charsmax(class));
chain = pev(next, pev_chain);
server_print("Found entity in player (%i) PVS: ent(%i) class(%s)", id, next, class);
if(!chain)
break;
next = chain;
}
}
So this function iterates over and over every entity until pev_chain is NULL.
__________________