Fix mguard freeze bug and improvements to frame handling

This commit is contained in:
BjossiAlfreds 2020-01-10 17:04:19 +00:00
parent f7b99b07c3
commit 0642b6aa18
2 changed files with 9 additions and 6 deletions

View file

@ -607,12 +607,20 @@ M_MoveFrame(edict_t *self)
if ((self->monsterinfo.nextframe) &&
(self->monsterinfo.nextframe >= move->firstframe) &&
(self->monsterinfo.nextframe <= move->lastframe))
{
if (self->s.frame != self->monsterinfo.nextframe)
{
self->s.frame = self->monsterinfo.nextframe;
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
}
self->monsterinfo.nextframe = 0;
}
else
{
/* prevent nextframe from leaking into a future move */
self->monsterinfo.nextframe = 0;
if (self->s.frame == move->lastframe)
{
if (move->endfunc)

View file

@ -1668,7 +1668,6 @@ soldier_duck(edict_t *self, float eta)
if (skill->value == 0)
{
self->monsterinfo.nextframe = FRAME_duck01;
self->monsterinfo.currentmove = &soldier_move_duck;
self->monsterinfo.duck_wait_time = level.time + eta + 1;
return;
@ -1678,18 +1677,14 @@ soldier_duck(edict_t *self, float eta)
if (r > (skill->value * 0.3))
{
self->monsterinfo.nextframe = FRAME_duck01;
self->monsterinfo.currentmove = &soldier_move_duck;
self->monsterinfo.duck_wait_time = level.time + eta + (0.1 * (3 - skill->value));
}
else
{
self->monsterinfo.nextframe = FRAME_attak301;
self->monsterinfo.currentmove = &soldier_move_attack3;
self->monsterinfo.duck_wait_time = level.time + eta + 1;
}
return;
}
mframe_t soldier_frames_blind[] = {