mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-26 06:00:50 +00:00
Investigated PVS report for g_turret and fixed uninitialized variable access
This commit is contained in:
parent
32419b8d3f
commit
03800dfcd5
1 changed files with 4 additions and 3 deletions
|
@ -597,7 +597,6 @@ SP_turret_driver(edict_t *self)
|
|||
void
|
||||
turret_brain_think(edict_t *self)
|
||||
{
|
||||
vec3_t target;
|
||||
vec3_t dir;
|
||||
vec3_t endpos;
|
||||
float reaction_time;
|
||||
|
@ -631,6 +630,9 @@ turret_brain_think(edict_t *self)
|
|||
|
||||
self->monsterinfo.trail_time = level.time;
|
||||
self->monsterinfo.aiflags &= ~AI_LOST_SIGHT;
|
||||
|
||||
VectorAdd(self->enemy->absmax, self->enemy->absmin, endpos);
|
||||
VectorScale(endpos, 0.5, endpos);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -656,8 +658,7 @@ turret_brain_think(edict_t *self)
|
|||
}
|
||||
|
||||
/* let the turret know where we want it to aim */
|
||||
VectorCopy(endpos, target);
|
||||
VectorSubtract(target, self->target_ent->s.origin, dir);
|
||||
VectorSubtract(endpos, self->target_ent->s.origin, dir);
|
||||
vectoangles(dir, self->target_ent->move_angles);
|
||||
|
||||
/* decide if we should shoot */
|
||||
|
|
Loading…
Reference in a new issue