From 08404e0949119347e8e046de03e30df1f94db903 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 23 Oct 2016 18:27:31 +0200 Subject: [PATCH] Apply fix from 2009 for ai_run() and ai_checkattack(), but w/o old bug To fix some bug, in baseq2 and xatrix if(coop->value) { if(FindTargeget(self)) { return; } } was moved from ai_run() to ai_checkattack(). Do the same here, but without the bug from yquake2/#151 --- src/g_ai.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/g_ai.c b/src/g_ai.c index 23288c0..9a47f58 100644 --- a/src/g_ai.c +++ b/src/g_ai.c @@ -1291,6 +1291,14 @@ ai_checkattack(edict_t *self, float dist) VectorCopy(self->enemy->s.origin, self->monsterinfo.blind_fire_target); self->monsterinfo.blind_fire_delay = 0; } + + if (coop && coop->value && (self->monsterinfo.search_time < level.time)) + { + if (FindTarget(self)) + { + return true; + } + } enemy_infront = infront(self, self->enemy); enemy_range = range(self, self->enemy); @@ -1581,14 +1589,6 @@ ai_run(edict_t *self, float dist) } } - if (coop->value) - { - if (FindTarget(self)) - { - return; - } - } - if ((self->monsterinfo.search_time) && (level.time > (self->monsterinfo.search_time + 20))) {