diff --git a/src/g_weapon.c b/src/g_weapon.c index 555f107..086659b 100644 --- a/src/g_weapon.c +++ b/src/g_weapon.c @@ -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); } diff --git a/src/monster/chick/chick.c b/src/monster/chick/chick.c index ea6dc99..60a2bad 100644 --- a/src/monster/chick/chick.c +++ b/src/monster/chick/chick.c @@ -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; + } }