Fixed stand-ground gladiators not attacking within a certain range

This commit is contained in:
BjossiAlfreds 2023-04-22 18:31:35 +00:00
parent 22617d8812
commit 2582a23103
1 changed files with 12 additions and 6 deletions

View File

@ -325,13 +325,19 @@ gladiator_attack(edict_t *self)
return;
}
/* a small safe zone */
VectorSubtract(self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
if (range <= (MELEE_DISTANCE + 32))
/* a small safe zone
but not for stand-ground ones since players can
abuse it by standing still inside this range
*/
if (!(self->monsterinfo.aiflags & AI_STAND_GROUND))
{
return;
VectorSubtract(self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
if (range <= (MELEE_DISTANCE + 32))
{
return;
}
}
/* charge up the railgun */