From a9f44e74d4f7bbc8d54260bbf0e34d5e1a1cad23 Mon Sep 17 00:00:00 2001 From: Marcel Schnelle Date: Sun, 21 Sep 2025 17:50:51 +0900 Subject: [PATCH] Wrap around hand selection when going out of bounds horizontally --- source/game.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/game.c b/source/game.c index 625ecc6..49a6604 100644 --- a/source/game.c +++ b/source/game.c @@ -851,8 +851,21 @@ void card_draw() void hand_set_focus(int index) { - if (index < 0 || index > hand_top || hand_state != HAND_SELECT) return; - selection_x = index; + if (hand_state != HAND_SELECT) return; + + // Wrap around to the other side of the hand when going out of bounds on either side + if (index < 0) + { + selection_x = hand_top; + } + else if (index > hand_top) + { + selection_x = 0; + } + else + { + selection_x = index; + } play_sfx(SFX_CARD_FOCUS, MM_BASE_PITCH_RATE + rand() % 512); }