1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-13 20:33:35 +08:00
Files
osu-lazer/osu.Game.Tests
T
Austin Moore f1ea3b354c Add empty hand check to moveCardFocus (#37489)
Resolves #37486

Original error log:
```
2026-04-22 21:47:58 [error]: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
2026-04-22 21:47:58 [error]: at System.Collections.Generic.List`1.get_Item(Int32 index)
2026-04-22 21:47:58 [error]: at osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Hand.PlayerHandOfCards.moveCardFocus(Int32 direction)
2026-04-22 21:47:58 [error]: at osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Hand.PlayerHandOfCards.OnKeyDown(KeyDownEvent e)
```

Currently,
```osu.Game\Screens\OnlinePlay\Matchmaking\RankedPlay\Hand\PlayerHandOfCards.cs::moveCardFocus```
does not account for the hand being empty (cards.Count ==0 ), and will
attempt to move the card focus in the given direction regardless, which
causes the above index out of range error.

Added empty hand check to moveCardFocus, and a matching test case to
TestScenePlayerCardHand.cs

New test case before changes, recreating the error:
<img width="986" height="232" alt="image"
src="https://github.com/user-attachments/assets/daa62081-c776-44bd-b0d2-382b2dac7938"
/>

After:
<img width="638" height="223" alt="image"
src="https://github.com/user-attachments/assets/d6dcd8b8-8caf-42e3-9999-93dfe3fb6452"
/>
f1ea3b354c · 2026-04-23 12:23:17 +09:00
History
..
2026-03-17 03:58:02 +09:00
2023-06-24 01:00:03 +09:00
2026-03-17 03:58:02 +09:00
2026-03-19 00:05:52 +09:00
2026-03-17 03:58:02 +09:00
2026-04-17 17:06:24 +09:00
2026-03-17 03:58:02 +09:00
2025-03-18 16:24:01 +09:00
2026-03-17 03:58:02 +09:00
2026-03-17 03:58:02 +09:00
2023-05-02 11:55:05 +03:00
2026-03-17 03:58:02 +09:00
2026-03-17 03:58:02 +09:00