Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Check before SetEnemy in squad monster
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave authored and nekonomicon committed Jun 5, 2021
1 parent 2c9cb0c commit 7a999bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dlls/squadmonster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 7a999bf

Please sign in to comment.