mirror of
https://github.com/yquake2/xatrix.git
synced 2024-11-10 06:42:22 +00:00
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
1 changed files with 9 additions and 4 deletions
13
src/g_ai.c
13
src/g_ai.c
|
@ -835,8 +835,11 @@ ai_run_melee(edict_t *self)
|
|||
|
||||
if (FacingIdeal(self))
|
||||
{
|
||||
self->monsterinfo.melee(self);
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
if (self->monsterinfo.melee)
|
||||
{
|
||||
self->monsterinfo.melee(self);
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -857,8 +860,10 @@ ai_run_missile(edict_t *self)
|
|||
|
||||
if (FacingIdeal(self))
|
||||
{
|
||||
self->monsterinfo.attack(self);
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
if (self->monsterinfo.attack) {
|
||||
self->monsterinfo.attack(self);
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue