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
This commit is contained in:
Daniel Gibson 2016-10-23 18:27:31 +02:00
parent b7b8bec0fd
commit 08404e0949
1 changed files with 8 additions and 8 deletions

View File

@ -1292,6 +1292,14 @@ ai_checkattack(edict_t *self, float dist)
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);
VectorSubtract(self->enemy->s.origin, self->s.origin, temp);
@ -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)))
{