mirror of https://github.com/yquake2/rogue.git
Fix a potential crash in ai_run_melee() and ai_run_missile().
This was found and fixed by Maraakate.
This commit is contained in:
parent
891e75c568
commit
02942e9544
11
src/g_ai.c
11
src/g_ai.c
|
@ -1045,10 +1045,13 @@ ai_run_melee(edict_t *self)
|
|||
}
|
||||
|
||||
if (FacingIdeal(self))
|
||||
{
|
||||
if (self->monsterinfo.melee)
|
||||
{
|
||||
self->monsterinfo.melee(self);
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1071,15 +1074,17 @@ ai_run_missile(edict_t *self)
|
|||
}
|
||||
|
||||
if (FacingIdeal(self))
|
||||
{
|
||||
if (self->monsterinfo.attack)
|
||||
{
|
||||
self->monsterinfo.attack(self);
|
||||
|
||||
if ((self->monsterinfo.attack_state == AS_MISSILE) ||
|
||||
(self->monsterinfo.attack_state == AS_BLIND))
|
||||
{
|
||||
(self->monsterinfo.attack_state == AS_BLIND)) {
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1115,7 +1120,7 @@ ai_run_slide(edict_t *self, float distance)
|
|||
}
|
||||
|
||||
/* clamp maximum sideways move for non flyers to make them look less jerky */
|
||||
if (!self->flags & FL_FLY)
|
||||
if (!(self->flags & FL_FLY))
|
||||
{
|
||||
distance = min(distance, 0.8);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue