X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=misc.c;h=34d045c64ab37c1430f339c7bdf4e5cf656606e2;hb=ff46cf7faccbc8a887c033c34681c526ca740747;hp=691d771eec7ab79d1d0a399c529a5af02f1a8d36;hpb=b7bf85904d00488f6902036d03e9db664b68de89;p=open-adventure.git diff --git a/misc.c b/misc.c index 691d771..34d045c 100644 --- a/misc.c +++ b/misc.c @@ -221,7 +221,7 @@ static char* get_input(void) // Print a blank line printf("\n"); - char* input = ""; + char* input; for (;;) { input = myreadline(input_prompt); @@ -699,7 +699,7 @@ bool tstbit(int mask, int bit) } void set_seed(int32_t seedval) -/* Set the LCG seed */ +/* Set the LCG1 seed */ { game.lcg_x = seedval % LCG_M; if (game.lcg_x < 0) { @@ -718,6 +718,9 @@ static int32_t get_next_lcg_value(void) { int32_t old_x = game.lcg_x; game.lcg_x = (LCG_A * game.lcg_x + LCG_C) % LCG_M; + if (settings.debug) { + printf("# random %d\n", old_x); + } return old_x; }