From eff6ad11da1a89cb89efe7af99710502bb75b811 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Sat, 23 Feb 2002 22:00:46 +0000 Subject: [PATCH] fix for explosions sometimes not being freed at very high framerates git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1555 d7cf8633-e32d-0410-b094-e92efae38249 --- r_explosion.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/r_explosion.c b/r_explosion.c index 4fa758ad..8bfd09d7 100644 --- a/r_explosion.c +++ b/r_explosion.c @@ -173,7 +173,7 @@ void R_NewExplosion(vec3_t org) fractalnoisequick(noise, EXPLOSIONGRID, 4); for (i = 0;i < MAX_EXPLOSIONS;i++) { - if (explosion[i].alpha <= 0.0f) + if (explosion[i].alpha <= 0.01f) { explosion[i].starttime = cl.time; explosion[i].time = explosion[i].starttime - 0.1; @@ -338,6 +338,11 @@ void R_MoveExplosion(explosion_t *e/*, explosiongas_t **list, explosiongas_t **l frametime = cl.time - e->time; e->time = cl.time; e->alpha = EXPLOSIONFADESTART - (cl.time - e->starttime) * EXPLOSIONFADERATE; + if (e->alpha <= 0.01f) + { + e->alpha = -1; + return; + } frictionscale = 1 - frametime; frictionscale = bound(0, frictionscale, 1); for (i = 0;i < EXPLOSIONVERTS;i++) -- 2.39.2