void havocbot_aim(entity this)
{
- vector selfvel, enemyvel;
+ vector myvel, enemyvel;
// if(this.flags & FL_INWATER)
// return;
if (time < this.nextaim)
return;
this.nextaim = time + 0.1;
- selfvel = this.velocity;
+ myvel = this.velocity;
if (!this.waterlevel)
- selfvel.z = 0;
+ myvel.z = 0;
if (this.enemy)
{
enemyvel = this.enemy.velocity;
if (!this.enemy.waterlevel)
enemyvel.z = 0;
- lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, selfvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);
+ lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, myvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);
}
else
- lag_additem(this, time + this.ping, 0, 0, world, this.origin, selfvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0');
+ lag_additem(this, time + this.ping, 0, 0, world, this.origin, myvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0');
}
bool havocbot_moveto_refresh_route(entity this)
// LordHavoc: disabled because this is too expensive
return '0 0 0';
#if 0
+SELFPARAM();
entity head;
vector dodge, v, n;
float danger, bestdanger, vl, d;
head = findchainfloat(bot_dodge, true);
while(head)
{
- if (head.owner != self)
+ if (head.owner != this)
{
vl = vlen(head.velocity);
if (vl > autocvar_sv_maxspeed * 0.3)
{
n = normalize(head.velocity);
- v = self.origin - head.origin;
+ v = this.origin - head.origin;
d = v * n;
if (d > (0 - head.bot_dodgerating))
if (d < (vl * 0.2 + head.bot_dodgerating))
}
else
{
- danger = head.bot_dodgerating - vlen(head.origin - self.origin);
+ danger = head.bot_dodgerating - vlen(head.origin - this.origin);
if (bestdanger < danger)
{
bestdanger = danger;
- dodge = normalize(self.origin - head.origin);
+ dodge = normalize(this.origin - head.origin);
}
}
}
bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
- //dprint("waypoint_think wpisbox = ", ftos(self.wpisbox), "\n");
- sm1 = self.origin + self.mins;
- sm2 = self.origin + self.maxs;
+ //dprint("waypoint_think wpisbox = ", ftos(this.wpisbox), "\n");
+ sm1 = this.origin + this.mins;
+ sm2 = this.origin + this.maxs;
for(e = world; (e = find(e, classname, "waypoint")); )
{
- if (boxesoverlap(self.absmin, self.absmax, e.absmin, e.absmax))
+ if (boxesoverlap(this.absmin, this.absmax, e.absmin, e.absmax))
{
- waypoint_addlink(self, e);
- waypoint_addlink(e, self);
+ waypoint_addlink(this, e);
+ waypoint_addlink(e, this);
}
else
{
++relink_total;
- if(!checkpvs(self.origin, e))
+ if(!checkpvs(this.origin, e))
{
++relink_pvsculled;
continue;
sv.x = bound(sm1_x, sv.x, sm2_x);
sv.y = bound(sm1_y, sv.y, sm2_y);
sv.z = bound(sm1_z, sv.z, sm2_z);
- ev = self.origin;
+ ev = this.origin;
em1 = e.origin + e.mins;
em2 = e.origin + e.maxs;
ev.x = bound(em1_x, ev.x, em2_x);
continue;
}
navigation_testtracewalk = 0;
- if (!self.wpisbox)
+ if (!this.wpisbox)
{
- tracebox(sv - STAT(PL_MIN, NULL).z * '0 0 1', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), sv, false, self);
+ tracebox(sv - STAT(PL_MIN, NULL).z * '0 0 1', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), sv, false, this);
if (!trace_startsolid)
{
//dprint("sv deviation", vtos(trace_endpos - sv), "\n");
ev = trace_endpos + '0 0 1';
}
}
- //traceline(self.origin, e.origin, false, world);
+ //traceline(this.origin, e.origin, false, world);
//if (trace_fraction == 1)
- if (!self.wpisbox && tracewalk(self, sv, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), ev, MOVE_NOMONSTERS))
- waypoint_addlink(self, e);
+ if (!this.wpisbox && tracewalk(this, sv, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), ev, MOVE_NOMONSTERS))
+ waypoint_addlink(this, e);
else
relink_walkculled += 0.5;
if (!e.wpisbox && tracewalk(e, ev, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), sv, MOVE_NOMONSTERS))
- waypoint_addlink(e, self);
+ waypoint_addlink(e, this);
else
relink_walkculled += 0.5;
}
}
navigation_testtracewalk = 0;
- self.wplinked = true;
+ this.wplinked = true;
}
void waypoint_clearlinks(entity wp)