Merge pull request #112 from BjossiAlfreds/gunnergren

Fixed gunner grenade duck code running twice
This commit is contained in:
Yamagi 2023-07-30 17:39:27 +02:00 committed by GitHub
commit 16eee95bb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -509,14 +509,6 @@ gunner_duck_down(edict_t *self)
self->monsterinfo.aiflags |= AI_DUCKED;
if (skill->value >= SKILL_HARD)
{
if (random() > 0.5)
{
GunnerGrenade(self);
}
}
self->maxs[2] = self->monsterinfo.base_height - 32;
self->takedamage = DAMAGE_YES;
@ -528,8 +520,23 @@ gunner_duck_down(edict_t *self)
gi.linkentity(self);
}
static void
gunner_duck_down_think(edict_t *self)
{
gunner_duck_down(self);
/* rogue code calls duck_down twice, so move this here */
if (skill->value >= SKILL_HARD)
{
if (random() > 0.5)
{
GunnerGrenade(self);
}
}
}
mframe_t gunner_frames_duck[] = {
{ai_move, 1, gunner_duck_down},
{ai_move, 1, gunner_duck_down_think},
{ai_move, 1, NULL},
{ai_move, 1, monster_duck_hold},
{ai_move, 0, NULL},