mirror of
https://github.com/yquake2/ctf.git
synced 2024-11-14 00:11:18 +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
6f1b2f101f
commit
5447354a76
1 changed files with 10 additions and 4 deletions
14
src/g_ai.c
14
src/g_ai.c
|
@ -810,8 +810,11 @@ ai_run_melee(edict_t *self)
|
||||||
|
|
||||||
if (FacingIdeal(self))
|
if (FacingIdeal(self))
|
||||||
{
|
{
|
||||||
self->monsterinfo.melee(self);
|
if (self->monsterinfo.melee)
|
||||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
{
|
||||||
|
self->monsterinfo.melee(self);
|
||||||
|
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -827,8 +830,11 @@ ai_run_missile(edict_t *self)
|
||||||
|
|
||||||
if (FacingIdeal(self))
|
if (FacingIdeal(self))
|
||||||
{
|
{
|
||||||
self->monsterinfo.attack(self);
|
if (self->monsterinfo.attack)
|
||||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
{
|
||||||
|
self->monsterinfo.attack(self);
|
||||||
|
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue