]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/antilag.qc
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / antilag.qc
index 0f6434eab68e3330c5807a4f46c664e8721cdf9f..68ec68324d78f785ff84fde5167d7a44a0b1493a 100644 (file)
@@ -66,9 +66,11 @@ vector antilag_takebackorigin(entity e, float t)
        i0 = antilag_find(e, t);
        if(i0 < 0)
        {
-               i0 = e.antilag_index - 1;
-               if(i0 < 0)
-                       i0 = ANTILAG_MAX_ORIGINS - 1;
+               // IN THE PRESENT
+               if(e.antilag_takenback)
+                       return e.antilag_saved_origin;
+               else
+                       return e.origin;
        }
        i1 = i0 + 1;
        if(i1 >= ANTILAG_MAX_ORIGINS)
@@ -111,3 +113,16 @@ void antilag_restore(entity e)
        setorigin(e, e.antilag_saved_origin);
        e.antilag_takenback = FALSE;
 }
+
+void antilag_clear(entity e)
+{
+       float i;
+
+       antilag_restore(e);
+       for(i = 0; i < ANTILAG_MAX_ORIGINS; ++i)
+       {
+               e.(antilag_times[i]) = -2342;
+               e.(antilag_origins[i]) = self.origin;
+       }
+       e.antilag_index = ANTILAG_MAX_ORIGINS - 1; // next one is 0
+}