]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/navigation.qc
Replace some more vlen checks with vdist and vlen2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / navigation.qc
index e4e389b15c915659d96f99195ddec174ae3b144d..6eb872bb16fd91887f70b7149a0bd6c869423113 100644 (file)
@@ -690,7 +690,7 @@ void navigation_routerating(entity this, entity e, float f, float rangebias)
        if(g_jetpack)
        if(this.items & IT_JETPACK)
        if(autocvar_bot_ai_navigation_jetpack)
-       if(vlen(this.origin - o) > autocvar_bot_ai_navigation_jetpack_mindistance)
+       if(vdist(this.origin - o, >, autocvar_bot_ai_navigation_jetpack_mindistance))
        {
                vector pointa, pointb;
 
@@ -925,7 +925,7 @@ void navigation_poptouchedgoals(entity this)
 
        // If for some reason the bot is closer to the next goal, pop the current one
        if(this.goalstack01)
-       if(vlen(this.goalcurrent.origin - this.origin) > vlen(this.goalstack01.origin - this.origin))
+       if(vlen2(this.goalcurrent.origin - this.origin) > vlen2(this.goalstack01.origin - this.origin))
        if(checkpvs(this.origin + this.view_ofs, this.goalstack01))
        if(tracewalk(this, this.origin, this.mins, this.maxs, (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5, bot_navigation_movemode))
        {
@@ -953,7 +953,7 @@ void navigation_poptouchedgoals(entity this)
        if(this.speed >= autocvar_sv_maxspeed) // if -really- running
        if(this.goalcurrent.classname=="waypoint")
        {
-               if(vlen(this.origin - this.goalcurrent.origin)<150)
+               if(vdist(this.origin - this.goalcurrent.origin, <, 150))
                {
                        traceline(this.origin + this.view_ofs , this.goalcurrent.origin, true, world);
                        if(trace_fraction==1)