This commit is contained in:
speedvoltage 2025-04-04 18:54:22 +03:00 committed by GitHub
commit 7fb419e51b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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" ) )
{