mirror of
https://github.com/ppy/osu.git
synced 2025-02-12 17:23:09 +08:00
Fix particles not spawning if Time.Current
is negative
This commit is contained in:
parent
761da45f6a
commit
d5a10e9221
@ -49,11 +49,7 @@ namespace osu.Game.Graphics
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
// reset cooldown if the clock was rewound.
|
if (Active.Value && CanSpawnParticles && Math.Abs(Time.Current - lastParticleAdded) > cooldown)
|
||||||
// this can happen when seeking in replays.
|
|
||||||
if (lastParticleAdded > Time.Current) lastParticleAdded = 0;
|
|
||||||
|
|
||||||
if (Active.Value && CanSpawnParticles && Time.Current > lastParticleAdded + cooldown)
|
|
||||||
{
|
{
|
||||||
var newParticle = CreateParticle();
|
var newParticle = CreateParticle();
|
||||||
newParticle.StartTime = (float)Time.Current;
|
newParticle.StartTime = (float)Time.Current;
|
||||||
@ -112,9 +108,6 @@ namespace osu.Game.Graphics
|
|||||||
{
|
{
|
||||||
foreach (var p in particles)
|
foreach (var p in particles)
|
||||||
{
|
{
|
||||||
// ignore particles that weren't initialized.
|
|
||||||
if (p.StartTime <= 0) continue;
|
|
||||||
|
|
||||||
var timeSinceStart = currentTime - p.StartTime;
|
var timeSinceStart = currentTime - p.StartTime;
|
||||||
|
|
||||||
// ignore particles from the future.
|
// ignore particles from the future.
|
||||||
|
Loading…
Reference in New Issue
Block a user