Skip to content

Commit

Permalink
A_Chase CHF_DONTLOOKALLAROUND
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRaveYard authored and madame-rachelle committed Aug 7, 2023
1 parent f4dc16b commit ea4ffa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/playsim/p_enemy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2207,6 +2207,7 @@ enum ChaseFlags
CHF_NOPOSTATTACKTURN = 128,
CHF_STOPIFBLOCKED = 256,
CHF_DONTIDLE = 512,
CHF_DONTLOOKALLAROUND = 1024,
};

void A_Wander(AActor *self, int flags)
Expand Down Expand Up @@ -2441,7 +2442,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
// hurt our old one temporarily.
actor->threshold = 0;
}
if (P_LookForPlayers (actor, true, NULL) && actor->target != actor->goal)
if (P_LookForPlayers (actor, !(flags & CHF_DONTLOOKALLAROUND), NULL) && actor->target != actor->goal)
{ // got a new target
actor->flags7 &= ~MF7_INCHASE;
return;
Expand Down Expand Up @@ -2616,7 +2617,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
lookForBetter = true;
}
AActor * oldtarget = actor->target;
gotNew = P_LookForPlayers (actor, true, NULL);
gotNew = P_LookForPlayers (actor, !(flags & CHF_DONTLOOKALLAROUND), NULL);
if (lookForBetter)
{
actor->flags3 |= MF3_NOSIGHTCHECK;
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/zscript/constants.zs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ enum EChaseFlags
CHF_NOPOSTATTACKTURN = 128,
CHF_STOPIFBLOCKED = 256,
CHF_DONTIDLE = 512,
CHF_DONTLOOKALLAROUND = 1024,

CHF_DONTTURN = CHF_NORANDOMTURN | CHF_NOPOSTATTACKTURN | CHF_STOPIFBLOCKED
};
Expand Down

0 comments on commit ea4ffa1

Please sign in to comment.