This commit is contained in:
2025-11-01 11:58:10 -07:00
parent e77db1f4c5
commit 5ce2371dc1
4 changed files with 303 additions and 63 deletions

View File

@@ -153,7 +153,7 @@ impl<R: Rng + 'static> RhaiAgent<R> {
})
.register_fn("rand_bool", {
let rng = rng.clone();
move |p: f32| rng.lock().gen_bool(p as f64)
move |p: f32| rng.lock().gen_bool((p as f64).clamp(0.0, 1.0))
})
.register_fn("rand_symb", {
let rng = rng.clone();