From 29ca171256d0c9ce8b7c2f91490e94fd0dc3e8af Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Fri, 1 Mar 2024 20:23:23 +0200 Subject: [PATCH] Spread out /make_npc starting velocities --- server/src/cmd.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 895b683b02..5d49f8b680 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -746,6 +746,13 @@ fn handle_make_npc( scale, loot, } => { + // Spread about spawned npcs + let vel = Vec3::new( + thread_rng().gen_range(-2.0..3.0), + thread_rng().gen_range(-2.0..3.0), + 10.0, + ); + let mut entity_builder = server .state .create_npc( @@ -760,7 +767,7 @@ fn handle_make_npc( ) .with(alignment) .with(scale) - .with(comp::Vel(Vec3::new(0.0, 0.0, 0.0))); + .with(comp::Vel(vel)); if let Some(agent) = agent { entity_builder = entity_builder.with(agent);