From 7a999bf987becaa268e50c6e40a609c949fff699 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 2 Jun 2021 02:10:30 +0300 Subject: [PATCH] Check before SetEnemy in squad monster --- dlls/squadmonster.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/squadmonster.cpp b/dlls/squadmonster.cpp index cbf3f19f..60479878 100644 --- a/dlls/squadmonster.cpp +++ b/dlls/squadmonster.cpp @@ -256,7 +256,10 @@ void CSquadMonster::SquadMakeEnemy( CBaseEntity *pEnemy ) if( pMember ) { // reset members who aren't activly engaged in fighting - if( pMember->m_hEnemy != pEnemy && !pMember->HasConditions( bits_COND_SEE_ENEMY ) ) + if( pMember->m_hEnemy != pEnemy && !pMember->HasConditions( bits_COND_SEE_ENEMY ) + && ( pMember->m_pSchedule && (pMember->m_pSchedule->iInterruptMask & bits_COND_NEW_ENEMY) ) + // My enemy might be not an enemy for member of my squad, e.g. if I was provoked by player. + && pMember->IRelationship(pEnemy) >= R_DL ) { if( pMember->m_hEnemy != 0 ) {