A_Chase CHF_DONTLOOKALLAROUND

This commit is contained in:
RaveYard 2023-08-07 14:41:52 +02:00 committed by Rachael Alexanderson
parent f4dc16b27a
commit ea4ffa10e5
2 changed files with 4 additions and 2 deletions

View file

@ -2207,6 +2207,7 @@ enum ChaseFlags
CHF_NOPOSTATTACKTURN = 128, CHF_NOPOSTATTACKTURN = 128,
CHF_STOPIFBLOCKED = 256, CHF_STOPIFBLOCKED = 256,
CHF_DONTIDLE = 512, CHF_DONTIDLE = 512,
CHF_DONTLOOKALLAROUND = 1024,
}; };
void A_Wander(AActor *self, int flags) void A_Wander(AActor *self, int flags)
@ -2441,7 +2442,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
// hurt our old one temporarily. // hurt our old one temporarily.
actor->threshold = 0; 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 { // got a new target
actor->flags7 &= ~MF7_INCHASE; actor->flags7 &= ~MF7_INCHASE;
return; return;
@ -2616,7 +2617,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
lookForBetter = true; lookForBetter = true;
} }
AActor * oldtarget = actor->target; AActor * oldtarget = actor->target;
gotNew = P_LookForPlayers (actor, true, NULL); gotNew = P_LookForPlayers (actor, !(flags & CHF_DONTLOOKALLAROUND), NULL);
if (lookForBetter) if (lookForBetter)
{ {
actor->flags3 |= MF3_NOSIGHTCHECK; actor->flags3 |= MF3_NOSIGHTCHECK;

View file

@ -141,6 +141,7 @@ enum EChaseFlags
CHF_NOPOSTATTACKTURN = 128, CHF_NOPOSTATTACKTURN = 128,
CHF_STOPIFBLOCKED = 256, CHF_STOPIFBLOCKED = 256,
CHF_DONTIDLE = 512, CHF_DONTIDLE = 512,
CHF_DONTLOOKALLAROUND = 1024,
CHF_DONTTURN = CHF_NORANDOMTURN | CHF_NOPOSTATTACKTURN | CHF_STOPIFBLOCKED CHF_DONTTURN = CHF_NORANDOMTURN | CHF_NOPOSTATTACKTURN | CHF_STOPIFBLOCKED
}; };