From 158d18f1a4e2d541e563a5446e5b37ffed9b98b1 Mon Sep 17 00:00:00 2001 From: voidanix <51296985+voidanix@users.noreply.github.com> Date: Mon, 27 Jul 2020 02:48:13 +0200 Subject: [PATCH] fix arithmetic exception when fading out plasma --- src/engine/renderparticles.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/engine/renderparticles.cpp b/src/engine/renderparticles.cpp index c62927f40..3dfe2c503 100644 --- a/src/engine/renderparticles.cpp +++ b/src/engine/renderparticles.cpp @@ -1237,10 +1237,7 @@ void create(int type, int color, int fade, const vec &p, float size, float blend { if(camera1->o.dist(p) > maxparticledistance) return; float collidez = collide ? p.z - raycube(p, vec(0, 0, -1), collide >= 0 ? COLLIDERADIUS : max(p.z, 0.0f), RAY_CLIPMAT) + (collide >= 0 ? COLLIDEERROR : 0) : -1; - int fmin = 1; - int fmax = fade*3; - int f = fmin + rnd(fmax); //help deallocater by using fade distribution rather than random - newparticle(p, vec(0, 0, 0), f, type, color, size, blend, grav, collide, pl)->val = collidez; + newparticle(p, vec(0, 0, 0), fade, type, color, size, blend, grav, collide, pl)->val = collidez; } void regularcreate(int type, int color, int fade, const vec &p, float size, float blend, int grav, int collide, physent *pl, int delay)