From 6d11bb4a2d5bc8ab7c1491639f1083532b1b8fd1 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 17 Sep 2016 09:58:14 +0200 Subject: Replace RNG with PCG random number generator --- src/dungeon.cc | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'src/dungeon.cc') diff --git a/src/dungeon.cc b/src/dungeon.cc index eeec226b..b02b2a87 100644 --- a/src/dungeon.cc +++ b/src/dungeon.cc @@ -5125,27 +5125,8 @@ void play_game() process_player_name(FALSE); } - /* Init the RNG */ - if (Rand_quick) - { - u32b seed; - - /* Basic seed */ - seed = (time(NULL)); - -#ifdef SET_UID - - /* Mutate the seed on Unix machines */ - seed = ((seed >> 3) * (getpid() << 1)); - -#endif - - /* Use the complex RNG */ - Rand_quick = FALSE; - - /* Seed the "complex" RNG */ - Rand_state_init(seed); - } + /* Force "complex" RNG */ + set_complex_rng(); /* Roll new character */ if (new_game) @@ -5156,8 +5137,8 @@ void play_game() /* The dungeon is not ready */ character_dungeon = FALSE; - /* Hack -- seed for flavors */ - seed_flavor = rand_int(0x10000000); + /* Set the seed for flavors */ + seed_flavor() = seed_t::system(); /* Roll up a new character */ player_birth(); -- cgit v1.2.3