From d946df32d93c093dbc224f91c32a3fb55b0c97f2 Mon Sep 17 00:00:00 2001 From: Daniel Sperl Date: Tue, 18 Sep 2018 10:03:14 +0200 Subject: [PATCH] fixed occasional division through zero after recent commit --- src/starling/extensions/ParticleSystem.as | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/starling/extensions/ParticleSystem.as b/src/starling/extensions/ParticleSystem.as index 55c0778..fab2ed1 100644 --- a/src/starling/extensions/ParticleSystem.as +++ b/src/starling/extensions/ParticleSystem.as @@ -248,8 +248,11 @@ package starling.extensions var timeBetweenParticles:Number = 1.0 / _emissionRate; // if we'd exceed capacity, lower spawn rate - if (_numParticles + (_frameTime / timeBetweenParticles) > maxNumParticles) + if (_numParticles < maxNumParticles && + _numParticles + (_frameTime / timeBetweenParticles) > maxNumParticles) + { timeBetweenParticles = _frameTime / (maxNumParticles - _numParticles); + } while (_frameTime > 0) {