Change to RwLock over Mutex, so we can read without locking, changes to BattleRandom to allow for cloning, and prevent race conditions.
This commit is contained in:
@@ -2,6 +2,7 @@ use rand::distributions::{Distribution, Uniform};
|
||||
use rand::{Rng, SeedableRng};
|
||||
use rand_pcg::Pcg32;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Random {
|
||||
seed: u128,
|
||||
distribution: Uniform<f64>,
|
||||
|
||||
Reference in New Issue
Block a user