[Refactor] Separate Round logic into its own file (#570)
* Everything works, need to clean up * cleanup * fix rebase issue * clang format * docs * clang format * clang format * address part of review * Protect against edge case when discarding at end of hand * Protect undiscard against popping a discarded card that doesn't exist * Protect against out of bounds access to the `played` cards stack * fix condition in `select_four_of_a_kind_cards_in_played_hand` * change `get_played_top() + 1` to `get_played_size()` * move `can_play/discard_hand` functions to round.c --------- Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "game.h"
|
||||
#include "game/round.h"
|
||||
#include "game_variables.h"
|
||||
#include "hand.h"
|
||||
#include "joker.h"
|
||||
@@ -1034,7 +1035,7 @@ static u32 half_joker_effect(
|
||||
|
||||
u32 effect_flags_ret = JOKER_EFFECT_FLAG_NONE;
|
||||
|
||||
int played_size = get_played_top() + 1;
|
||||
int played_size = get_played_size();
|
||||
if (played_size <= 3)
|
||||
{
|
||||
*joker_effect = &shared_joker_effect;
|
||||
|
||||
Reference in New Issue
Block a user