Fix searching "player" entity

►  Improved the dynamic nature of how entities are located, particularly making it context-sensitive to the entity doing the search.
This commit is contained in:
speedvoltage 2025-03-12 17:05:56 +01:00
parent a62efecf62
commit 6ef114b5be

View file

@ -526,7 +526,14 @@ CBaseEntity *CGlobalEntityList::FindEntityProcedural( const char *szName, CBaseE
//
if ( FStrEq( pName, "player" ) )
{
return (CBaseEntity *)UTIL_PlayerByIndex( 1 );
if ( pSearchingEntity )
{
return FindEntityGenericNearest( "player", pSearchingEntity->GetAbsOrigin(), 0, pSearchingEntity, pActivator, pCaller );
}
else
{
return ( CBaseEntity * ) UTIL_PlayerByIndex( 1 );
}
}
else if ( FStrEq( pName, "pvsplayer" ) )
{