X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fg_subs.qc;h=5ad223c0cc13f8c9fd332ba3813c252b775becdc;hb=b2df32d96df3e954d54f6e4b9bbb6c98d77ef507;hp=28511b0ad0b91c9b4ef7def58fdbc466d7995c4c;hpb=0551f8173d6b71484c04ccf19963280a6211ee0e;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/server/g_subs.qc b/data/qcsrc/server/g_subs.qc index 28511b0a..5ad223c0 100644 --- a/data/qcsrc/server/g_subs.qc +++ b/data/qcsrc/server/g_subs.qc @@ -16,10 +16,6 @@ void spawnfunc_info_null (void) void setanim(entity e, vector anim, float looping, float override, float restart) { - // don't attempt to animate the stomach model - if(substring(self.model, strlen(self.model) - 8 - 4, 8) == "_stomach") // - 4 is the extension - return; - if (anim_x == e.animstate_startframe) if (anim_y == e.animstate_numframes) if (anim_z == e.animstate_framerate) @@ -58,29 +54,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; +} /* ================== @@ -689,3 +674,4 @@ float InitMovingBrushTrigger() } return 1; }; +#endif