]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_subs.qc
simplify
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_subs.qc
index 1d1f0bb9bd0f1bfee26d37846ad17085026bbdb4..47f3a5a699b8daa78b7d9a896304a5ae681a6a0c 100644 (file)
@@ -364,13 +364,13 @@ void traceline_antilag_force (entity source, vector v1, vector v2, float nomonst
 }
 void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-       if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+       if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
        traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
 }
 void tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
 {
-       if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+       if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
        tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, FALSE);
 }
@@ -380,13 +380,13 @@ void WarpZone_traceline_antilag_force (entity source, vector v1, vector v2, floa
 }
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-       if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+       if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
        WarpZone_traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
 }
 void WarpZone_tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
 {
-       if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+       if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
        tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, TRUE);
 }
@@ -605,17 +605,16 @@ float angc (float a1, float a2)
 .float loddistance1;
 .float loddistance2;
 
-vector NearestPointOnBox(entity box, vector org);
 float LOD_customize()
 {
        float d;
 
-       if(cvar("loddebug"))
+       if(autocvar_loddebug)
        {
-               d = cvar("loddebug");
+               d = autocvar_loddebug;
                if(d == 1)
                        self.modelindex = self.lodmodelindex0;
-               else if(d == 2)
+               else if(d == 2 || !self.lodmodelindex2)
                        self.modelindex = self.lodmodelindex1;
                else // if(d == 3)
                        self.modelindex = self.lodmodelindex2;
@@ -668,7 +667,7 @@ void LODmodel_attach()
                }
        }
 
-       if(cvar("loddebug") < 0)
+       if(autocvar_loddebug < 0)
        {
                self.lodmodel1 = self.lodmodel2 = ""; // don't even initialize
        }
@@ -695,7 +694,8 @@ void LODmodel_attach()
        }
 
        if(self.lodmodelindex1)
-               SetCustomizer(self, LOD_customize, LOD_uncustomize);
+               if not(self.SendEntity)
+                       SetCustomizer(self, LOD_customize, LOD_uncustomize);
 }
 
 void SetBrushEntityModel()
@@ -750,9 +750,7 @@ void InitTrigger()
 {
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
-       if (self.movedir == '0 0 0')
-       if (self.angles != '0 0 0')
-               SetMovedir ();
+       SetMovedir ();
        self.solid = SOLID_TRIGGER;
        SetBrushEntityModel();
        self.movetype = MOVETYPE_NONE;
@@ -764,9 +762,7 @@ void InitSolidBSPTrigger()
 {
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
-       if (self.movedir == '0 0 0')
-       if (self.angles != '0 0 0')
-               SetMovedir ();
+       SetMovedir ();
        self.solid = SOLID_BSP;
        SetBrushEntityModel();
        self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0