Refactor/RNG system (#476)
* Extract rng manipulation to its own file * clang format * Get CPU cycles since game start to use for RNG * change a few things * clang format * Implement suggestions from @ricfehr3 * clang format * Fix rebase issue * clang format * Create RngInfo struct to hold seed and step * clang format * Make a note about rng_restore system not having been tested properly yet * Apply suggestions from @ricfehr3 Co-authored-by: Rickey <ric@rf3.xyz> * clang format --------- Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com> Co-authored-by: Rickey <ric@rf3.xyz>
This commit is contained in:
co-authored by
Rickey
MathisMartin31
parent
e3f680d6d0
commit
c2844a5d32
+2
-1
@@ -4,6 +4,7 @@
|
||||
#include "game.h"
|
||||
#include "graphic_utils.h"
|
||||
#include "list.h"
|
||||
#include "random.h"
|
||||
#include "stdbool.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -139,7 +140,7 @@ enum BlindType roll_blind_type(bool showdown)
|
||||
}
|
||||
|
||||
// roll a random blind among the unbeaten ones
|
||||
int random_blind_idx = get_rand() % list_get_len(p_unbeaten_blinds);
|
||||
int random_blind_idx = rng_get_u32() % list_get_len(p_unbeaten_blinds);
|
||||
Blind* random_blind = list_get_at_idx(p_unbeaten_blinds, random_blind_idx);
|
||||
|
||||
return random_blind->type;
|
||||
|
||||
Reference in New Issue
Block a user