Skip to content

Commit

Permalink
Merge pull request #24547 from bdach/slider-kiai-stars-broke
Browse files Browse the repository at this point in the history
Fix kiai stars flickering on and off during gameplay
  • Loading branch information
peppy authored Aug 15, 2023
2 parents 31c31a9 + ab1d523 commit 57e4949
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions osu.Game/Graphics/ParticleSpewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,27 @@ protected ParticleSpewer(Texture texture, int perSecond, double maxDuration)
this.maxDuration = maxDuration;
}

protected override void LoadComplete()
{
base.LoadComplete();

Active.BindValueChanged(active =>
{
// ensure that particles can be spawned immediately after the spewer becomes active.
if (active.NewValue)
lastParticleAdded = null;
});
}

protected override void Update()
{
base.Update();

Invalidate(Invalidation.DrawNode);

if (!Active.Value || !CanSpawnParticles)
{
lastParticleAdded = null;
return;
}

// Always want to spawn the first particle in an activation immediately.
if (lastParticleAdded == null)
{
lastParticleAdded = Time.Current;
Expand Down

0 comments on commit 57e4949

Please sign in to comment.