1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-03 20:53:21 +08:00

Fix hit lighting dictating lifetime even when not present in skin

This commit is contained in:
Dean Herbert 2020-11-18 16:18:58 +09:00
parent 9d0a6de26e
commit 9d3de5bca0
2 changed files with 7 additions and 5 deletions

View File

@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
bool hitLightingEnabled = config.Get<bool>(OsuSetting.HitLighting);
if (hitLightingEnabled)
if (hitLightingEnabled && Lighting.Drawable != null)
{
Lighting.ScaleTo(0.8f).ScaleTo(1.2f, 600, Easing.Out);
Lighting.FadeIn(200).Then().Delay(200).FadeOut(1000);

View File

@ -139,12 +139,14 @@ namespace osu.Game.Rulesets.Judgements
animatable.PlayAnimation();
drawableAnimation.Expire(true);
// a derived version of DrawableJudgement may be adjusting lifetime.
// if not adjusted (or the skinned portion requires greater bounds than calculated) use the skinned source's lifetime.
if (LifetimeEnd == double.MaxValue || drawableAnimation.LifetimeEnd > LifetimeEnd)
LifetimeEnd = drawableAnimation.LifetimeEnd;
double lastTransformTime = drawableAnimation.LatestTransformEndTime;
if (LifetimeEnd == double.MaxValue || lastTransformTime > LifetimeEnd)
{
LifetimeEnd = lastTransformTime;
}
}
}
}