Merge pull request #84 from BjossiAlfreds/gladrange

Fixed stand-ground gladiators not attacking at certain range
This commit is contained in:
Yamagi 2023-05-08 18:07:38 +02:00 committed by GitHub
commit 9626e71c86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 12 deletions

View file

@ -289,13 +289,19 @@ gladb_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 */

View file

@ -275,13 +275,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 */