Merge pull request #32 from BjossiAlfreds/gladrange

Fixed stand-ground gladiators not attacking at certain range
This commit is contained in:
Yamagi 2023-05-08 18:07:59 +02:00 committed by GitHub
commit d4698d39dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,10 +237,15 @@ void gladiator_attack(edict_t *self)
} }
// a small safe zone // 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))
{
VectorSubtract (self->s.origin, self->enemy->s.origin, v); VectorSubtract (self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v); range = VectorLength(v);
if (range <= (MELEE_DISTANCE + 32)) if (range <= (MELEE_DISTANCE + 32))
return; return;
}
// charge up the railgun // charge up the railgun
gi.sound (self, CHAN_WEAPON, sound_gun, 1, ATTN_NORM, 0); gi.sound (self, CHAN_WEAPON, sound_gun, 1, ATTN_NORM, 0);