summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/submit/submit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/submit/submit.c b/src/modules/submit/submit.c
index 3e25dc5..daac37b 100644
--- a/src/modules/submit/submit.c
+++ b/src/modules/submit/submit.c
@@ -304,10 +304,12 @@ static void submit_prepare_frame(til_module_context_t *context, unsigned ticks,
setup_grid(ctxt);
for (int i = 0; i < NUM_PLAYERS; i++) {
- int moves = rand() % TICKS_PER_FRAME;
+ int moves = rand_r(&ctxt->til_module_context.seed) % TICKS_PER_FRAME;
for (int j = 0; j < moves; j++)
- grid_player_plan(ctxt->players[i], ctxt->seq++, rand() % GRID_SIZE, rand() % GRID_SIZE);
+ grid_player_plan(ctxt->players[i], ctxt->seq++,
+ rand_r(&ctxt->til_module_context.seed) % GRID_SIZE,
+ rand_r(&ctxt->til_module_context.seed) % GRID_SIZE);
}
for (int j = 0; j < TICKS_PER_FRAME; j++)
© All Rights Reserved