From 083ca12678662eb55b8411fd6ca523d5d44af4c6 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Fri, 23 Dec 2005 10:25:36 +0000 Subject: [PATCH] have to keep the old behavior git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1741 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/r_part.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/engine/client/r_part.c b/engine/client/r_part.c index 2dff8bb64..d71e40992 100644 --- a/engine/client/r_part.c +++ b/engine/client/r_part.c @@ -539,7 +539,14 @@ void P_ParticleEffect_f(void) else if (!strcmp(var, "scaledelta")) ptype->scaledelta = atof(value); - else if (!strcmp(var, "count") || !strcmp(var, "step")) + + else if (!strcmp(var, "step")) + { + ptype->count = 1/atof(value); + if (Cmd_Argc()>2) + ptype->countrand = 1/atof(Cmd_Argv(2)); + } + else if (!strcmp(var, "count")) { ptype->count = atof(value); if (Cmd_Argc()>2) @@ -2769,7 +2776,7 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype ts = NULL; // use ptype step to calc step vector and step size - step = ptype->count; + step = 1/ptype->count; if (step < 0.01) step = 0.01; @@ -2877,9 +2884,9 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype // if (ptype->spawnmode == SM_TRACER) if (ptype->spawnparam1) - tcount = (int)(len / ptype->count / ptype->spawnparam1); + tcount = (int)(len * ptype->count / ptype->spawnparam1); else - tcount = (int)(len / ptype->count); + tcount = (int)(len * ptype->count); if (ptype->colorindex >= 0) { @@ -3042,7 +3049,7 @@ static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype if (ptype->countrand) { - float rstep = ptype->countrand * frandom(); + float rstep = frandom() / ptype->countrand; VectorMA(start, rstep, vec, start); step += rstep; }