Fix minor AI glitches with turrets

This commit is contained in:
BjossiAlfreds 2023-08-22 20:14:47 +00:00
parent 16eee95bb8
commit 70c4c50951
1 changed files with 15 additions and 0 deletions

View File

@ -887,6 +887,7 @@ turret_wake(edict_t *self)
self->monsterinfo.sight = turret_sight;
self->monsterinfo.search = turret_search;
self->monsterinfo.currentmove = &turret_move_stand;
self->takedamage = DAMAGE_AIM;
self->movetype = MOVETYPE_NONE;
self->monsterinfo.aiflags |= AI_DO_NOT_COUNT;
@ -895,6 +896,11 @@ turret_wake(edict_t *self)
stationarymonster_start(self);
if (self->think)
{
self->think(self);
}
if (self->spawnflags & SPAWN_MACHINEGUN)
{
self->s.skinnum = 1;
@ -915,6 +921,11 @@ turret_activate(edict_t *self, edict_t *other, edict_t *activator)
vec3_t forward;
edict_t *base;
if (self->movetype == MOVETYPE_PUSH)
{
return;
}
self->movetype = MOVETYPE_PUSH;
if (!self->speed)
@ -950,6 +961,10 @@ turret_activate(edict_t *self, edict_t *other, edict_t *activator)
{
VectorSet(forward, 0, -1, 0);
}
else
{
VectorClear(forward);
}
/* start up the turret */
VectorMA(self->s.origin, 32, forward, endpos);