X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Futil.qc;h=3b54e08d0d72ed7b5fdf5878eb0260c3344f7361;hp=afd7f1c5ce25ea2bad16b2d3dda0c58c30d4ddad;hb=6d249c399e3e08bac4f671d875e1a58ba52a5a34;hpb=8a000d27bdf428db93e0304c4fdee5a26b89e9e8 diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index afd7f1c5c..3b54e08d0 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -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