aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/entity/mod.rs')
-rw-r--r--server/src/entity/mod.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/src/entity/mod.rs b/server/src/entity/mod.rs
index 2eadc0ff..6d69436d 100644
--- a/server/src/entity/mod.rs
+++ b/server/src/entity/mod.rs
@@ -150,7 +150,8 @@ pub enum EntityDecl {
Book,
Pedestrians {
spawn_delay: f32,
- spawn_delay_stdev: f32,
+ spawn_delay_stdev: Option<f32>,
+ speed: Option<f32>,
points: Vec<Vec2>,
},
}
@@ -240,11 +241,17 @@ pub fn construct_entity(
spawn_delay,
spawn_delay_stdev,
points,
+ speed,
} => Box::new(Pedestrians {
players: HashMap::new(),
points,
- spawn_delay_distr: rand_distr::Normal::new(spawn_delay, spawn_delay_stdev).unwrap(),
+ spawn_delay_distr: rand_distr::Normal::new(
+ spawn_delay,
+ spawn_delay_stdev.unwrap_or(0.),
+ )
+ .unwrap(),
cooldown: 0.,
+ speed: speed.unwrap_or(0.6),
}),
})
}