allow removing rules

This commit is contained in:
Crispy 2024-05-01 23:15:44 +02:00
parent 79cd0a8fe4
commit c435d96f33
2 changed files with 13 additions and 3 deletions

View file

@ -112,7 +112,9 @@ impl Dish {
}
pub fn fire_blindly(&mut self) {
assert!(!self.rules.is_empty());
if self.rules.is_empty() {
return;
}
let x = random::<usize>() % CHUNK_SIZE;
let y = random::<usize>() % CHUNK_SIZE;
let rule = random::<usize>() % self.rules.len();