From 5e2a0bd73302f2f6be74bb9792d0e067f1c092ac Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 19 Jul 2023 14:10:27 +0900 Subject: [PATCH] Fix spawning edge case when elapsed became unexpectedly negative --- osu.Game/Graphics/ParticleSpewer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/ParticleSpewer.cs b/osu.Game/Graphics/ParticleSpewer.cs index 9cf3fb1882..37a4fe77bd 100644 --- a/osu.Game/Graphics/ParticleSpewer.cs +++ b/osu.Game/Graphics/ParticleSpewer.cs @@ -66,12 +66,13 @@ namespace osu.Game.Graphics { lastParticleAdded = Time.Current; spawnParticle(); + return; } - double timeElapsed = Math.Abs(Time.Current - lastParticleAdded.Value); + double timeElapsed = Time.Current - lastParticleAdded.Value; // Avoid spawning too many particles if a long amount of time has passed. - if (timeElapsed > maxDuration) + if (Math.Abs(timeElapsed) > maxDuration) { lastParticleAdded = Time.Current; spawnParticle();