Refactor/hand (#490)

* move all hand funcs to their new file. now to clean up

* WIP

* Cleanup + doc hand.h

* clang format

* Refactor loose variables in hand.c into a proper Hand struct

* Fix some more issues

* Apply *some* suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* remove outdated comment

* fix rebase issue

* fix rng_info missing from g_game_vars init

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Geralt
2026-05-22 17:51:39 -07:00
committed by GitHub
co-authored by Copilot Autofix powered by AI MathisMartin31
parent d7414157a5
commit 2329c4c681
9 changed files with 1235 additions and 1043 deletions
+3 -5
View File
@@ -1,6 +1,6 @@
#include "game.h"
#include "game_variables.h"
#include "hand_analysis.h"
#include "hand.h"
#include "joker.h"
#include "list.h"
#include "pool.h"
@@ -678,8 +678,7 @@ static u32 blackboard_joker_effect(
bool all_cards_are_spades_or_clubs = true;
CardObject** hand = get_hand_array();
int hand_size = hand_get_size();
for (int i = 0; i < hand_size; i++)
for (int i = 0; i < g_game_vars.hand_size; i++)
{
u8 suit = hand[i]->card->suit;
if (suit == HEARTS || suit == DIAMONDS)
@@ -737,8 +736,7 @@ static u32 raised_fist_joker_effect(
*p_lowest_value_index = 0;
u8 lowest_value = IMPOSSIBLY_HIGH_CARD_VALUE;
CardObject** hand = get_hand_array();
int hand_size = hand_get_size();
for (int i = 0; i < hand_size; i++)
for (int i = 0; i < g_game_vars.hand_size; i++)
{
u8 value = card_get_value(hand[i]->card);
if (lowest_value > value)