new_org = org + ofs;
e.velocity = trigger_push_calculatevelocity(new_org, t, this.height);
vel = e.velocity;
- if(vlen(vec2(e.velocity)) < autocvar_sv_maxspeed)
+ if (vdist(vec2(e.velocity), <, autocvar_sv_maxspeed))
e.velocity = autocvar_sv_maxspeed * flatdir;
if (trigger_push_testorigin(e, t, this, new_org) && (!valid_best_target || trace_endpos.z > best_target.z + 50))
{
new_org = org - ofs;
e.velocity = trigger_push_calculatevelocity(new_org, t, this.height);
vel = e.velocity;
- if(vlen(vec2(e.velocity)) < autocvar_sv_maxspeed)
+ if (vdist(vec2(e.velocity), <, autocvar_sv_maxspeed))
e.velocity = autocvar_sv_maxspeed * flatdir;
if (trigger_push_testorigin(e, t, this, new_org) && (!valid_best_target || trace_endpos.z > best_target.z + 50))
{
// Run only to visible goals
if(IS_ONGROUND(this))
- if(vlen(this.velocity - eZ * this.velocity.z) >= autocvar_sv_maxspeed) // if -really- running
+ if(vdist(vec2(this.velocity), >=, autocvar_sv_maxspeed)) // if -really- running
if(checkpvs(this.origin + this.view_ofs, this.goalcurrent))
{
this.bot_lastseengoal = this.goalcurrent;
//if (this.bot_dodgevector_time < time)
{
- // this.bot_dodgevector_time = time + cvar("bot_ai_dodgeupdateinterval");
- // this.bot_dodgevector_jumpbutton = 1;
+ //this.bot_dodgevector_time = time + cvar("bot_ai_dodgeupdateinterval");
+ //this.bot_dodgevector_jumpbutton = 1;
evadeobstacle = '0 0 0';
evadelava = '0 0 0';
{
if(this.waterlevel>WATERLEVEL_SWIMMING)
{
- // flatdir_z = 1;
+ //flatdir_z = 1;
this.aistatus |= AI_STATUS_OUT_WATER;
}
else
// Loose goal touching check when running
if(this.aistatus & AI_STATUS_RUNNING)
if(this.goalcurrent.classname=="waypoint")
- if(vlen(this.velocity - eZ * this.velocity.z) >= autocvar_sv_maxspeed) // if -really- running
+ if(vdist(vec2(this.velocity), >=, autocvar_sv_maxspeed)) // if -really- running
{
if(vdist(this.origin - this.goalcurrent.origin, <, 150))
{