From 36005a5449d4169edf7d77d948d1b0c0b38e2abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 12 Feb 2024 08:33:08 +0100 Subject: [PATCH] Fix selected legacy skins crashing on zero-length hold notes Closes https://github.com/ppy/osu/issues/27134. --- osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs index 07045b76ca..a8200e0144 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs @@ -243,7 +243,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy bodySprite.FillMode = FillMode.Stretch; // 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;