summaryrefslogtreecommitdiff
path: root/src/dungeon.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:14 +0200
committerBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:14 +0200
commit6d11bb4a2d5bc8ab7c1491639f1083532b1b8fd1 (patch)
tree0a1ee125b7c5ef7ec37ff0781392989be4f75e26 /src/dungeon.cc
parent36969a9058806e71078efcb04a91cc263612d42e (diff)
Replace RNG with PCG random number generator
Diffstat (limited to 'src/dungeon.cc')
-rw-r--r--src/dungeon.cc27
1 files changed, 4 insertions, 23 deletions
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();