From 983e516fb4ebc1f2def592f2b7f3195d968deed2 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 9 Nov 2024 21:54:30 +0300 Subject: [PATCH] fix: emitter does not skip particles --- src/graphics/render/Emitter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/render/Emitter.cpp b/src/graphics/render/Emitter.cpp index 582410db..82848a63 100644 --- a/src/graphics/render/Emitter.cpp +++ b/src/graphics/render/Emitter.cpp @@ -64,6 +64,7 @@ void Emitter::update( return; } } + timer += delta; const float maxDistance = preset.maxDistance; if (glm::distance2(position, cameraPosition) > maxDistance * maxDistance) { if (count > 0) { @@ -77,7 +78,6 @@ void Emitter::update( } return; } - timer += delta; while (count && timer > spawnInterval) { // spawn particle Particle particle = prototype;