Try to make lightning beam particles not endlessly spawn without dying while paused.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5910 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-06-21 16:55:58 +00:00
parent 0c41ac0b7d
commit d6e09af52d
1 changed files with 11 additions and 10 deletions

View File

@ -2878,7 +2878,7 @@ void CSQC_GetEntityOrigin(unsigned int csqcent, float *out);
CL_UpdateBeams CL_UpdateBeams
================= =================
*/ */
void CL_UpdateBeams (void) void CL_UpdateBeams (float frametime)
{ {
int bnum; int bnum;
int i, j; int i, j;
@ -3053,7 +3053,7 @@ void CL_UpdateBeams (void)
} }
if (ruleset_allow_particle_lightning.ival || !type->modelname) if (ruleset_allow_particle_lightning.ival || !type->modelname)
if (type->ef_beam >= 0 && !P_ParticleTrail(org, b->end, type->ef_beam, host_frametime, b->entity, NULL, &b->trailstate)) if (type->ef_beam >= 0 && !P_ParticleTrail(org, b->end, type->ef_beam, frametime, b->entity, NULL, &b->trailstate))
continue; continue;
if (!type->model) if (!type->model)
{ {
@ -3111,7 +3111,7 @@ void CL_UpdateBeams (void)
CL_UpdateExplosions CL_UpdateExplosions
================= =================
*/ */
void CL_UpdateExplosions (void) void CL_UpdateExplosions (float frametime)
{ {
int i; int i;
float f; float f;
@ -3122,12 +3122,7 @@ void CL_UpdateExplosions (void)
entity_t *ent; entity_t *ent;
int lastrunningexplosion = -1; int lastrunningexplosion = -1;
vec3_t pos, norm; vec3_t pos, norm;
static float oldtime;
float scale; float scale;
float frametime = cl.time - oldtime;
if (frametime < 0 || frametime > 100)
frametime = 0;
oldtime = cl.time;
for (i=0, ex=cl_explosions; i < explosions_running; i++, ex++) for (i=0, ex=cl_explosions; i < explosions_running; i++, ex++)
{ {
@ -3264,7 +3259,13 @@ CL_UpdateTEnts
*/ */
void CL_UpdateTEnts (void) void CL_UpdateTEnts (void)
{ {
CL_UpdateBeams (); static float oldtime;
CL_UpdateExplosions (); float frametime = cl.time - oldtime;
if (frametime < 0 || frametime > 100)
frametime = 0;
oldtime = cl.time;
CL_UpdateBeams (frametime);
CL_UpdateExplosions (frametime);
CL_RunPCustomTEnts (); CL_RunPCustomTEnts ();
} }