Merge pull request #117 from BjossiAlfreds/turret-fixes

Fix minor AI glitches with turrets
This commit is contained in:
Yamagi 2023-09-14 21:19:43 +02:00 committed by GitHub
commit 772e396fb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);