]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Minor maths improvements
authorMario <mario@smbclan.net>
Mon, 4 Jan 2016 06:53:56 +0000 (16:53 +1000)
committerMario <mario@smbclan.net>
Mon, 4 Jan 2016 06:55:03 +0000 (16:55 +1000)
qcsrc/lib/warpzone/server.qc
qcsrc/server/g_subs.qc

index 21f69a80d5dee81c24925d6cad5076ee9cb3db2d..e9fdf771a1a98f3eab485b9c162e9acba637e659 100644 (file)
@@ -873,7 +873,8 @@ void WarpZone_StartFrame()
                if(warpzone_warpzones_exist)
                        WarpZone_StoreProjectileData(it);
 
-               if((IS_OBSERVER(it) || it.solid == SOLID_NOT) && IS_REAL_CLIENT(it))
+               if((IS_OBSERVER(it) || it.solid == SOLID_NOT))
+               if(IS_REAL_CLIENT(it))
                {
                        other = it; // player
 
index ecba3669a389e60df7a3bfdfea89efae2b45fccf..5c2896dbe0b973a4a250b3c889247a27111c1d19 100644 (file)
@@ -235,11 +235,9 @@ vector findbetterlocation (vector org, float mindist)
 
 float LOD_customize()
 {SELFPARAM();
-       float d;
-
        if(autocvar_loddebug)
        {
-               d = autocvar_loddebug;
+               int d = autocvar_loddebug;
                if(d == 1)
                        self.modelindex = self.lodmodelindex0;
                else if(d == 2 || !self.lodmodelindex2)
@@ -250,10 +248,10 @@ float LOD_customize()
        }
 
        // TODO csqc network this so it only gets sent once
-       d = vlen(NearestPointOnBox(self, other.origin) - other.origin);
-       if(d < self.loddistance1)
+       vector near_point = NearestPointOnBox(self, other.origin);
+       if(vdist(near_point - other.origin, <, self.loddistance1))
                self.modelindex = self.lodmodelindex0;
-       else if(!self.lodmodelindex2 || d < self.loddistance2)
+       else if(!self.lodmodelindex2 || vdist(near_point - other.origin, <, self.loddistance2))
                self.modelindex = self.lodmodelindex1;
        else
                self.modelindex = self.lodmodelindex2;