mirror of https://github.com/yquake2/xatrix.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
99a032c6ae
commit
a9b24bfa04
|
@ -834,11 +834,14 @@ ai_run_melee(edict_t *self)
|
|||
M_ChangeYaw(self);
|
||||
|
||||
if (FacingIdeal(self))
|
||||
{
|
||||
if (self->monsterinfo.melee)
|
||||
{
|
||||
self->monsterinfo.melee(self);
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Turn in place until within
|
||||
|
@ -857,10 +860,12 @@ ai_run_missile(edict_t *self)
|
|||
|
||||
if (FacingIdeal(self))
|
||||
{
|
||||
if (self->monsterinfo.attack) {
|
||||
self->monsterinfo.attack(self);
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Strafe sideways, but stay
|
||||
|
|
Loading…
Reference in New Issue