1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 17:47:18 +08:00

Clamp AimCount to ensure at least one triangle is spawned

This commit is contained in:
Dean Herbert 2022-11-25 20:14:21 +09:00
parent 4cb068ceb9
commit b0f14d4963

View File

@ -172,7 +172,7 @@ namespace osu.Game.Graphics.Backgrounds
// Limited by the maximum size of QuadVertexBuffer for safety.
const int max_triangles = ushort.MaxValue / (IRenderer.VERTICES_PER_QUAD + 2);
AimCount = (int)Math.Min(max_triangles, DrawWidth * 0.02f * SpawnRatio);
AimCount = (int)Math.Clamp(DrawWidth * 0.02f * SpawnRatio, 1, max_triangles);
int currentCount = parts.Count;