1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:02:54 +08:00

Merge pull request #27138 from bdach/legacy-body-piece-crash

Fix selected legacy skins crashing on zero-length hold notes
This commit is contained in:
Salman Ahmed 2024-02-16 01:02:32 +03:00 committed by GitHub
commit 66b413619b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -243,7 +243,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
bodySprite.FillMode = FillMode.Stretch; bodySprite.FillMode = FillMode.Stretch;
// i dunno this looks about right?? // i dunno this looks about right??
bodySprite.Scale = new Vector2(1, scaleDirection * 32800 / sprite.DrawHeight); // the guard against zero draw height is intended for zero-length hold notes. yes, such cases have been spotted in the wild.
if (sprite.DrawHeight > 0)
bodySprite.Scale = new Vector2(1, scaleDirection * 32800 / sprite.DrawHeight);
} }
break; break;