I am trying to check if an origin can be in a player's potenially view set so far i've made this, but its buggy, because it create entities.
PHP Code:
// Is Origin in player's potentially view set?
bool:IsOriginInPlayerPVS(const id, const Float:fOrigin[3])
{
static iEnt, next, Float:fEntOrigin[3];
iEnt = create_entity("info_target");
if( iEnt )
{
engfunc(EngFunc_SetOrigin, iEnt, fOrigin);
next = engfunc(EngFunc_EntitiesInPVS, id);
while( next )
{
pev(next, pev_origin, fEntOrigin);
if( xs_vec_equal(fOrigin, fEntOrigin) )
{
set_pev(iEnt, pev_flags, FL_KILLME);
dllfunc(DLLFunc_Think, iEnt);
return true;
}
next = pev(next, pev_chain);
}
set_pev(iEnt, pev_flags, FL_KILLME);
dllfunc(DLLFunc_Think, iEnt);
return false;
}
return false;
}
Edit: Looking through Xash3D engine i found out this native Mod_GetPVSForPoint but i couldn't locate its function.
__________________