From 9ae9e7ec3ad5467d78d7d048c06548998b3ce027 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 2 Nov 2018 23:51:06 -0400 Subject: [PATCH] Check for valid source in A_JawzChase, change 1 target rule --- src/p_enemy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index c4d1fe41..ea10b62b 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8261,6 +8261,9 @@ void A_JawzChase(mobj_t *actor) if (actor->tracer) { + if (G_RaceGametype()) // Stop looking after first target in race + actor->extravalue1 = 1; + if (actor->tracer->health) { mobj_t *ret; @@ -8280,13 +8283,13 @@ void A_JawzChase(mobj_t *actor) if (actor->extravalue1) // Disable looking by setting this return; + if (actor->target && !P_MobjWasRemoved(actor->target)) // No source! + return; + player = K_FindJawzTarget(actor, actor->target->player); if (player) P_SetTarget(&actor->tracer, player->mo); - if (G_RaceGametype()) // Stop looking after first tic in race - actor->extravalue1 = 1; - return; }