]> 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 22c8931bef8813bc43536ab950b281b1a7def223..c397079e91d9381e9f81d4306dad0426ff8545da 100644 (file)
@@ -16,6 +16,9 @@ void spawnfunc_info_null (void)
 
 void setanim(entity e, vector anim, float looping, float override, float restart)
 {
+       if (!anim)
+               return; // no animation was given to us! We can't use this. 
+               
        if (anim_x == e.animstate_startframe)
        if (anim_y == e.animstate_numframes)
        if (anim_z == e.animstate_framerate)
@@ -55,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;
+}
 
 /*
 ==================