When finding nearest friend, skip the dying ones as well (they shouldn't participate in talking) (#398)

This commit is contained in:
Roman Chistokhodov 2023-10-17 18:15:10 +03:00 committed by GitHub
parent 17b34aa42b
commit 3cf40ccf12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -791,7 +791,7 @@ CBaseEntity *CTalkMonster::FindNearestFriend( BOOL fPlayer )
// for each friend in this bsp...
while( ( pFriend = UTIL_FindEntityByClassname( pFriend, pszFriend ) ) )
{
if( pFriend == this || !pFriend->IsAlive() )
if( pFriend == this || !pFriend->IsAlive() || pFriend->pev->deadflag != DEAD_NO )
// don't talk to self or dead people
continue;