aboutsummaryrefslogtreecommitdiff
path: root/pixel-client/src/menu/background.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-06-03 20:00:18 +0200
committermetamuffin <metamuffin@disroot.org>2025-06-03 20:00:18 +0200
commitdb4587d3ec64b7e28691b43f9d9701939eed94d1 (patch)
tree1005017ea4a5d4e287024eaf08f876c7e34bfbdb /pixel-client/src/menu/background.rs
parent9ee7eef2919feffe4e0695494d4027e8ec011808 (diff)
downloadhurrycurry-db4587d3ec64b7e28691b43f9d9701939eed94d1.tar
hurrycurry-db4587d3ec64b7e28691b43f9d9701939eed94d1.tar.bz2
hurrycurry-db4587d3ec64b7e28691b43f9d9701939eed94d1.tar.zst
update rust toolchain and rust dependencies.
`map_many_mut` and `trait_upcasting` was stabilized.
Diffstat (limited to 'pixel-client/src/menu/background.rs')
-rw-r--r--pixel-client/src/menu/background.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/pixel-client/src/menu/background.rs b/pixel-client/src/menu/background.rs
index 84ec3f34..13cb041d 100644
--- a/pixel-client/src/menu/background.rs
+++ b/pixel-client/src/menu/background.rs
@@ -23,7 +23,7 @@ use hurrycurry_protocol::{
glam::{IVec2, Vec2},
TileIndex,
};
-use rand::{random, seq::IndexedRandom, thread_rng};
+use rand::{random, rng, seq::IndexedRandom};
pub struct MenuBackground {
background: Vec2,
@@ -54,7 +54,7 @@ impl MenuBackground {
let p = Vec2::new(x as f32, y as f32);
let w = (-p.length() * 0.15).exp();
let k = ((random::<f32>() * w) * BUCKETS.len() as f32) as usize;
- if let Some(ti) = BUCKETS[k.min(BUCKETS.len())].choose(&mut thread_rng()) {
+ if let Some(ti) = BUCKETS[k.min(BUCKETS.len())].choose(&mut rng()) {
map.set(IVec2::new(x, y), Some(TileIndex(*ti)), [None; 4])
}
}