Merge pull request #66 from cellos51/bug_fixes

Fixed a bug where selecting discard with 0 discards would toggle card select and extracted function game_playing_process_hand_select_input() from game_playing_process_input_and_state()
This commit is contained in:
MeirGavish
2025-07-27 23:20:01 +03:00
committed by GitHub
+9 -4
View File
@@ -1038,9 +1038,7 @@ void game_init()
tte_printf("#{P:%d,%d; cx:0xC000}%d#{cx:0xF000}/%d", ANTE_TEXT_RECT.left, ANTE_TEXT_RECT.top, ante, MAX_ANTE); // Ante
}
static void game_playing_process_input_and_state()
{
if (hand_state == HAND_SELECT)
static void game_playing_process_hand_select_input()
{
static bool discard_button_highlighted = false; // true = play button highlighted, false = discard button highlighted
@@ -1120,19 +1118,26 @@ static void game_playing_process_input_and_state()
{
memcpy16(&pal_bg_mem[1], &pal_bg_mem[7], 1); // Play button highlight color
memcpy16(&pal_bg_mem[9], &pal_bg_mem[12], 1); // Discard button highlight color
}
if (key_hit(SELECT_CARD))
{
hand_select();
set_hand();
}
}
if (key_hit(SORT_HAND))
{
hand_change_sort();
}
}
static void game_playing_process_input_and_state()
{
if (hand_state == HAND_SELECT)
{
game_playing_process_hand_select_input();
}
else if (play_state == PLAY_ENDING)
{
if (mult > 0)