2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-16 23:19:49 +01:00

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

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;