mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix particles not spawning if Time.Current
is negative
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user