1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Fix particles not spawning if Time.Current is negative

This commit is contained in:
Opelkuh 2021-09-19 14:47:20 +02:00
parent 761da45f6a
commit d5a10e9221

View File

@ -49,11 +49,7 @@ namespace osu.Game.Graphics
{
base.Update();
// reset cooldown if the clock was rewound.
// this can happen when seeking in replays.
if (lastParticleAdded > Time.Current) lastParticleAdded = 0;
if (Active.Value && CanSpawnParticles && Time.Current > lastParticleAdded + cooldown)
if (Active.Value && CanSpawnParticles && Math.Abs(Time.Current - lastParticleAdded) > cooldown)
{
var newParticle = CreateParticle();
newParticle.StartTime = (float)Time.Current;
@ -112,9 +108,6 @@ namespace osu.Game.Graphics
{
foreach (var p in particles)
{
// ignore particles that weren't initialized.
if (p.StartTime <= 0) continue;
var timeSinceStart = currentTime - p.StartTime;
// ignore particles from the future.