diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-12 11:01:21 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-12 23:48:49 -0500 |
| commit | ab1392bba09f8b58dc496b3a3f5b980bc5b475c8 (patch) | |
| tree | 2044f352eb84e473d037e0b74428914c04e5a754 /dungeon/src/entity.rs | |
| parent | dungeon: bsp generate should return a floor to use same single rng (diff) | |
| download | DungeonCrawl-ab1392bba09f8b58dc496b3a3f5b980bc5b475c8.tar.gz DungeonCrawl-ab1392bba09f8b58dc496b3a3f5b980bc5b475c8.tar.bz2 DungeonCrawl-ab1392bba09f8b58dc496b3a3f5b980bc5b475c8.zip | |
dungeon: switch to only using small rng from rand
Diffstat (limited to 'dungeon/src/entity.rs')
| -rw-r--r-- | dungeon/src/entity.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index 82042b5..de21c28 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -93,8 +93,8 @@ impl EnemyMoveState { pub fn new_roam(starting_pos: Pos, floor: &mut Floor) -> Self { let mut loop_index = 0; loop { - let dir = Direction::random(floor.rand()); - let dist = floor.rand().random_range(MIN_ROAM_DIST..=MAX_ROAM_DIST); + let dir = floor.rng().random(); + let dist = floor.rng().random_range(MIN_ROAM_DIST..=MAX_ROAM_DIST); if let Some(p) = starting_pos.step_by(dir, dist) { if !floor.get(p).is_wall() { |