]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qc
Merge branch 'master' into divVerent/csad
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qc
index afd7f1c5ce25ea2bad16b2d3dda0c58c30d4ddad..3b54e08d0d72ed7b5fdf5878eb0260c3344f7361 100644 (file)
@@ -901,8 +901,8 @@ float cvar_settemp(string tmp_cvar, string tmp_value)
 
 float cvar_settemp_restore()
 {
-       float i;
-       entity e;
+       float i = 0;
+       entity e = world;
        while((e = find(e, classname, "saved_cvar_value")))
        {
                if(cvar_type(e.netname))
@@ -2475,3 +2475,32 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
        for(queue_start = e; queue_start; queue_start = queue_start.fld)
                queue_start.FindConnectedComponent_processing = 0;
 }
+
+vector vec3(float x, float y, float z)
+{
+       vector v;
+       v_x = x;
+       v_y = y;
+       v_z = z;
+       return v;
+}
+
+#ifndef MENUQC
+vector animfixfps(entity e, vector a, vector b)
+{
+       // multi-frame anim: keep as-is
+       if(a_y == 1)
+       {
+               float dur;
+               dur = frameduration(e.modelindex, a_x);
+               if(dur <= 0 && b_y)
+               {
+                       a = b;
+                       dur = frameduration(e.modelindex, a_x);
+               }
+               if(dur > 0)
+                       a_z = 1.0 / dur;
+       }
+       return a;
+}
+#endif