mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-25 05:31:56 +00:00
Merge pull request #117 from BjossiAlfreds/turret-fixes
Fix minor AI glitches with turrets
This commit is contained in:
commit
772e396fb5
1 changed files with 15 additions and 0 deletions
|
@ -887,6 +887,7 @@ turret_wake(edict_t *self)
|
||||||
self->monsterinfo.sight = turret_sight;
|
self->monsterinfo.sight = turret_sight;
|
||||||
self->monsterinfo.search = turret_search;
|
self->monsterinfo.search = turret_search;
|
||||||
self->monsterinfo.currentmove = &turret_move_stand;
|
self->monsterinfo.currentmove = &turret_move_stand;
|
||||||
|
|
||||||
self->takedamage = DAMAGE_AIM;
|
self->takedamage = DAMAGE_AIM;
|
||||||
self->movetype = MOVETYPE_NONE;
|
self->movetype = MOVETYPE_NONE;
|
||||||
self->monsterinfo.aiflags |= AI_DO_NOT_COUNT;
|
self->monsterinfo.aiflags |= AI_DO_NOT_COUNT;
|
||||||
|
@ -895,6 +896,11 @@ turret_wake(edict_t *self)
|
||||||
|
|
||||||
stationarymonster_start(self);
|
stationarymonster_start(self);
|
||||||
|
|
||||||
|
if (self->think)
|
||||||
|
{
|
||||||
|
self->think(self);
|
||||||
|
}
|
||||||
|
|
||||||
if (self->spawnflags & SPAWN_MACHINEGUN)
|
if (self->spawnflags & SPAWN_MACHINEGUN)
|
||||||
{
|
{
|
||||||
self->s.skinnum = 1;
|
self->s.skinnum = 1;
|
||||||
|
@ -915,6 +921,11 @@ turret_activate(edict_t *self, edict_t *other, edict_t *activator)
|
||||||
vec3_t forward;
|
vec3_t forward;
|
||||||
edict_t *base;
|
edict_t *base;
|
||||||
|
|
||||||
|
if (self->movetype == MOVETYPE_PUSH)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
self->movetype = MOVETYPE_PUSH;
|
self->movetype = MOVETYPE_PUSH;
|
||||||
|
|
||||||
if (!self->speed)
|
if (!self->speed)
|
||||||
|
@ -950,6 +961,10 @@ turret_activate(edict_t *self, edict_t *other, edict_t *activator)
|
||||||
{
|
{
|
||||||
VectorSet(forward, 0, -1, 0);
|
VectorSet(forward, 0, -1, 0);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VectorClear(forward);
|
||||||
|
}
|
||||||
|
|
||||||
/* start up the turret */
|
/* start up the turret */
|
||||||
VectorMA(self->s.origin, 32, forward, endpos);
|
VectorMA(self->s.origin, 32, forward, endpos);
|
||||||
|
|
Loading…
Reference in a new issue