View Single Post
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-18-2022 , 13:10   How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #1

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 
iEntnextFloat:fEntOrigin[3];

    
iEnt create_entity("info_target");

    if( 
iEnt )
    {
        
engfunc(EngFunc_SetOriginiEntfOrigin);

        
next engfunc(EngFunc_EntitiesInPVSid);

        while( 
next )
        {
            
pev(nextpev_originfEntOrigin);

            if( 
xs_vec_equal(fOriginfEntOrigin) )
            {
                
set_pev(iEntpev_flagsFL_KILLME);
                
dllfunc(DLLFunc_ThinkiEnt);

                return 
true;
            }

            
next pev(nextpev_chain);
        }

        
set_pev(iEntpev_flagsFL_KILLME);
        
dllfunc(DLLFunc_ThinkiEnt);

        return 
false;
    }

    return 
false;

Edit: Looking through Xash3D engine i found out this native Mod_GetPVSForPoint but i couldn't locate its function.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-21-2022 at 17:25.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh