]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_subs.qc
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_subs.qc
index c311f3774f45f59c7ad934e6b5992e673c1b4f54..c397079e91d9381e9f81d4306dad0426ff8545da 100644 (file)
@@ -58,29 +58,18 @@ void updateanim(entity e)
        //print(ftos(time), " -> ", ftos(e.frame), "\n");
 };
 
-float animparseerror;
-vector animparseline(float animfile)
-{
-       local string line;
-       local float c;
-       local vector anim;
-       if (animfile < 0)
-               return '0 1 2';
-       line = fgets(animfile);
-       c = tokenize_console(line);
-       if (c < 3)
+vector animfixfps(entity e, vector a)
+{
+       // multi-frame anim: keep as-is
+       if(a_y == 1)
        {
-               animparseerror = TRUE;
-               return '0 1 2';
+               float dur;
+               dur = frameduration(e.modelindex, a_x);
+               if(dur > 0)
+                       a_z = 1.0 / dur;
        }
-       anim_x = stof(argv(0));
-       anim_y = stof(argv(1));
-       anim_z = stof(argv(2));
-       // don't allow completely bogus values
-       if (anim_x < 0 || anim_y < 1 || anim_z < 0.001)
-               anim = '0 1 2';
-       return anim;
-};
+       return a;
+}
 
 /*
 ==================