summaryrefslogtreecommitdiff
path: root/dungeon
diff options
context:
space:
mode:
Diffstat (limited to 'dungeon')
-rw-r--r--dungeon/src/map.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/dungeon/src/map.rs b/dungeon/src/map.rs
index fef0750..19c1de8 100644
--- a/dungeon/src/map.rs
+++ b/dungeon/src/map.rs
@@ -1,7 +1,7 @@
//! The `map` module contains structures of the dungeon game map
//! including the current `Floor`, and map `Tile`.
-use rand::{Rng, SeedableRng, rngs::StdRng};
+use rand::{rngs::StdRng, Rng, SeedableRng, TryRngCore};
use strum::IntoEnumIterator;
use strum_macros::EnumIter;
@@ -116,7 +116,8 @@ impl Floor {
/// ```
#[must_use]
pub fn generate() -> Self {
- let seed = rand::random();
+ let mut rng = rand::rngs::OsRng;
+ let seed = rng.try_next_u64().unwrap_or(0);
Self::generate_seeded(seed)
}