totalspawned += 1;
makevectors(self.v_angle);
- WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 150, MOVE_NORMAL, self);
+ WarpZone_TraceBox (CENTER_OR_VIEWOFS(self), PL_MIN, PL_MAX, CENTER_OR_VIEWOFS(self) + v_forward * 150, TRUE, self);
+ //WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 150, MOVE_NORMAL, self);
e = spawnmonster(tospawn, 0, self, self, trace_endpos, FALSE, moveflag);
if(mname) e.netname = strzone(mname);
self.state = 0;
self.touch = MonsterTouch;
}
-
- //v_forward = normalize(self.moveto - self.origin);
//self.steerto = steerlib_attract2(self.moveto, 0.5, 500, 0.95);
if(self.state != MONSTER_STATE_ATTACK_LEAP && self.state != MONSTER_STATE_ATTACK_MELEE)
turny = 20;
- if(g_td)
+ if(g_td || self.flags & FL_SWIM)
turny = vlen(self.angles - self.moveto);
if(turny)
else if(self.enemy)
self.moveto = self.moveto * 0.9 + ((self.origin + v_forward * 500) + randomvec() * 400) * 0.1;
- if(!(self.flags & FL_FLY || self.flags & FL_SWIM))
+ if not(self.flags & FL_FLY || self.flags & FL_SWIM)
self.moveto_z = self.origin_z;
float l = vlen(self.moveto - self.origin);
float t1 = trace_path(self.origin+'0 0 10', self.moveto+'0 0 10');
float t2 = trace_path(self.origin-'0 0 15', self.moveto-'0 0 15');
+ if(self.flags & FL_FLY || self.flags & FL_SWIM)
+ v_forward = normalize(self.moveto - self.origin);
+
if(t1*l-t2*l>50 && (t1*l > 100 || t1 > 0.8))
if(self.flags & FL_ONGROUND)
movelib_jump_simple(100);