From f1c7317c5ab2a148e5188e091cd1aa3490dc8b4d Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 24 Dec 2024 05:35:02 +0300 Subject: [PATCH] fix non-skipping particles --- src/graphics/render/Emitter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/graphics/render/Emitter.cpp b/src/graphics/render/Emitter.cpp index 88951588..e908ece8 100644 --- a/src/graphics/render/Emitter.cpp +++ b/src/graphics/render/Emitter.cpp @@ -77,6 +77,10 @@ void Emitter::update( count = std::max(0, count - skipped); timer -= skipped * spawnInterval; } + if (count < 0) { + int skipped = timer / spawnInterval; + timer -= skipped * spawnInterval; + } return; } while (count && timer > spawnInterval) {