mirror of
https://github.com/yquake2/xatrix.git
synced 2025-02-24 04:41:58 +00:00
Beta-class iron maiden fixes
This commit is contained in:
parent
debf08a512
commit
3eabed0f71
2 changed files with 13 additions and 17 deletions
|
@ -1341,16 +1341,14 @@ heat_think(edict_t *self)
|
|||
edict_t *target = NULL;
|
||||
edict_t *aquire = NULL;
|
||||
vec3_t vec;
|
||||
int len;
|
||||
int oldlen = 0;
|
||||
float len;
|
||||
float oldlen = 0;
|
||||
|
||||
if (!self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VectorClear(vec);
|
||||
|
||||
/* aquire new target */
|
||||
while ((target = findradius(target, self->s.origin, 1024)) != NULL)
|
||||
{
|
||||
|
@ -1359,11 +1357,6 @@ heat_think(edict_t *self)
|
|||
continue;
|
||||
}
|
||||
|
||||
if ((!target->svflags) & SVF_MONSTER)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!target->client)
|
||||
{
|
||||
continue;
|
||||
|
@ -1374,12 +1367,12 @@ heat_think(edict_t *self)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!visible(self, target))
|
||||
if (!infront(self, target))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!infront(self, target))
|
||||
if (!visible(self, target))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1387,20 +1380,18 @@ heat_think(edict_t *self)
|
|||
VectorSubtract(self->s.origin, target->s.origin, vec);
|
||||
len = VectorLength(vec);
|
||||
|
||||
if ((aquire == NULL) || (len < oldlen))
|
||||
if ((!aquire) || (len < oldlen))
|
||||
{
|
||||
aquire = target;
|
||||
self->target_ent = aquire;
|
||||
oldlen = len;
|
||||
}
|
||||
}
|
||||
|
||||
if (aquire != NULL)
|
||||
if (aquire)
|
||||
{
|
||||
VectorSubtract(aquire->s.origin, self->s.origin, vec);
|
||||
vectoangles(vec, self->s.angles);
|
||||
VectorNormalize(vec);
|
||||
VectorCopy(vec, self->movedir);
|
||||
VectorScale(vec, 500, self->velocity);
|
||||
}
|
||||
|
||||
|
|
|
@ -631,7 +631,7 @@ ChickRocket(edict_t *self)
|
|||
VectorSubtract(vec, start, dir);
|
||||
VectorNormalize(dir);
|
||||
|
||||
if (self->s.skinnum > 1)
|
||||
if (!strcmp(self->classname, "monster_chick_heat"))
|
||||
{
|
||||
monster_fire_heat(self, start, dir, 50, 500, MZ2_CHICK_ROCKET_1);
|
||||
}
|
||||
|
@ -949,5 +949,10 @@ SP_monster_chick_heat(edict_t *self)
|
|||
}
|
||||
|
||||
SP_monster_chick(self);
|
||||
self->s.skinnum = 3;
|
||||
|
||||
/* have to check this since the regular spawn function can free the entity */
|
||||
if (self->inuse)
|
||||
{
|
||||
self->s.skinnum = 3;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue