]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
try fixing issues with cl_gunalign
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index c54235d2cbdbc1a8ffe493209a72a4681cda8f5c..5b0fa2b8caabc429fd3bdae394326bffb1ef616b 100644 (file)
@@ -229,12 +229,6 @@ void relocate_spawnpoint()
         }
     }
 
-    if (cvar("g_spawnpoints_autodrop"))
-    {
-        setsize(self, PL_MIN, PL_MAX);
-        droptofloor();
-    }
-
     self.use = spawnpoint_use;
     self.team_saved = self.team;
     if (!self.cnt)
@@ -1227,7 +1221,6 @@ void readlevelcvars(void)
        sv_maxidle = cvar("sv_maxidle");
        sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
        sv_pogostick = cvar("sv_pogostick");
-       sv_doublejump = cvar("sv_doublejump");
        g_ctf_reverse = cvar("g_ctf_reverse");
        sv_autotaunt = cvar("sv_autotaunt");
        sv_taunt = cvar("sv_taunt");
@@ -1916,6 +1909,13 @@ void adaptor_think2use()
     activator = a;
 }
 
+void adaptor_think2use_hittype_splash() // for timed projectile detonation
+{
+       if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+               self.projectiledeathtype |= HITTYPE_SPLASH;
+       adaptor_think2use();
+}
+
 // deferred dropping
 void DropToFloor_Handler()
 {
@@ -2330,9 +2330,9 @@ void write_recordmarker(entity pl, float tstart, float dt)
                  " ", ftos(tstart), " ", ftos(dt), "\n"));
 }
 
-vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter)
+vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter, float algn)
 {
-       switch(self.owner.cvar_cl_gunalign)
+       switch(algn)
        {
                case 1: // right
                        break;
@@ -2372,7 +2372,7 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter
        return vecs;
 }
 
-vector shotorg_adjust(vector vecs, float y_is_right, float visual)
+vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float algn)
 {
        string s;
        vector v;
@@ -2381,7 +2381,7 @@ vector shotorg_adjust(vector vecs, float y_is_right, float visual)
        {
                if (visual)
                {
-                       vecs = shotorg_adjustfromclient(vecs, y_is_right, TRUE);
+                       vecs = shotorg_adjustfromclient(vecs, y_is_right, TRUE, algn);
                }
                else
                {
@@ -2393,7 +2393,7 @@ vector shotorg_adjust(vector vecs, float y_is_right, float visual)
        {
                if (visual)
                {
-                       vecs = shotorg_adjustfromclient(vecs, y_is_right, TRUE);
+                       vecs = shotorg_adjustfromclient(vecs, y_is_right, TRUE, algn);
                }
                else
                {
@@ -2413,11 +2413,15 @@ vector shotorg_adjust(vector vecs, float y_is_right, float visual)
        }
        else if (cvar("g_shootfromclient"))
        {
-               vecs = shotorg_adjustfromclient(vecs, y_is_right, (cvar("g_shootfromclient") >= 2));
+               vecs = shotorg_adjustfromclient(vecs, y_is_right, (cvar("g_shootfromclient") >= 2), algn);
        }
        return vecs;
 }
 
+vector shotorg_adjust(vector vecs, float y_is_right, float visual)
+{
+       return shotorg_adjust_values(vecs, y_is_right, visual, self.owner.cvar_cl_gunalign);
+}
 
 
 void attach_sameorigin(entity e, entity to, string tag)