]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Kill some more vlen uses
authorMario <mario@smbclan.net>
Wed, 31 Aug 2016 06:44:46 +0000 (16:44 +1000)
committerMario <mario@smbclan.net>
Wed, 31 Aug 2016 08:07:23 +0000 (18:07 +1000)
qcsrc/client/view.qc
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/g_damage.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/steerlib.qc

index 8a583ba699ee74e5443c1afd1456eca77740d02c..cd156e65ec7b3989e0afc6ce1d8a08faa4c4aa12 100644 (file)
@@ -980,7 +980,7 @@ void HUD_Crosshair(entity this)
                                v = wcross_origin - wcross_oldorigin;
                                v.x /= vid_conwidth;
                                v.y /= vid_conheight;
-                               if(vlen(v) > 0.01)
+                               if(vdist(v, >, 0.01))
                                        shottype = SHOTTYPE_HITOBSTRUCTION;
                        }
                        if(!autocvar_crosshair_hittest_showimpact)
index efcd5ba3731243acd0260c36d43c0e451d856829..5fb923799acfa41f863414a7ed96d33253874acd 100644 (file)
@@ -34,7 +34,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
        w.solid = SOLID_TRIGGER;
        setorigin(w, (m1 + m2) * 0.5);
        setsize(w, m1 - w.origin, m2 - w.origin);
-       if (vlen(w.size) > 0)
+       if (w.size)
                w.wpisbox = true;
 
        if(!w.wpisbox)
@@ -280,7 +280,7 @@ void waypoint_schedulerelink(entity wp)
        }
        else
                wp.model = "";
-       wp.wpisbox = vlen(wp.size) > 0;
+       wp.wpisbox = vdist(wp.size, >, 0);
        wp.enemy = NULL;
        if (!(wp.wpflags & WAYPOINTFLAG_PERSONAL))
                wp.owner = NULL;
index acf2d40aee5233935b6569cb445a0c52c4d1ca88..a5e4a7547a51289d1d670dca53676910de761daa 100644 (file)
@@ -26,7 +26,7 @@ float FullTraceFraction(vector a, vector mi, vector ma, vector b)
        float n, m;
        n = m = 0;
 
-       while (vlen(c - b) > 1)
+       while (vdist(c - b, >, 1))
        {
                ++m;
 
index 97e82b50edf683eb38804743a13913fedf7f984a..3e448363655f6ce712a84efb3af74f3202a68db1 100644 (file)
@@ -839,7 +839,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
 
        // apply push
        if (targ.damageforcescale)
-       if (vlen(force))
+       if (force)
        if (!IS_PLAYER(targ) || time >= targ.spawnshieldtime || targ == attacker)
        {
                vector farce = damage_explosion_calcpush(targ.damageforcescale * force, targ.velocity, autocvar_g_balance_damagepush_speedfactor);
@@ -863,7 +863,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                UpdateCSQCProjectile(targ);
        }
        // apply damage
-       if (damage != 0 || (targ.damageforcescale && vlen(force)))
+       if (damage != 0 || (targ.damageforcescale && force))
        if (targ.event_damage)
                targ.event_damage (targ, inflictor, attacker, damage, deathtype, hitloc, force);
 
@@ -1038,7 +1038,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                        //      print(" finaldmg ", ftos(finaldmg), " force ", vtos(force));
                                        //      print(" (", ftos(a), ")\n");
                                        //}
-                                       if(finaldmg || vlen(force))
+                                       if(finaldmg || force)
                                        {
                                                if(targ.iscreature)
                                                {
index 3471083a964481bfd2819245c8f9f424eea175d7..0e5d7bd02a6ca2f3e63ecce293067c6f59211da1 100644 (file)
@@ -423,7 +423,7 @@ void kh_Key_Damage(entity this, entity inflictor, entity attacker, float damage,
                // immediately return is bad
                // maybe start a shorter countdown?
        }
-       if(vlen(force) <= 0)
+       if(force == '0 0 0')
                return;
        if(time > this.pushltime)
                if(IS_PLAYER(attacker))
index 5312eb8140b06d1002e3c6471ec98238d8112622..1544fa384a5cbbf16eb4cebf3bf89be17faf1c1f 100644 (file)
@@ -144,7 +144,7 @@ vector steerlib_wander(entity this, float range, float tresh, vector oldpoint)
     vector wander_point;
     wander_point = v_forward - oldpoint;
 
-    if (vlen(wander_point) > tresh)
+    if (vdist(wander_point, >, tresh))
         return oldpoint;
 
     range = bound(0,range,1);