diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 00fa748f3b..a4609a180b 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -413,24 +413,26 @@ impl Body { } // How far away other entities should try to be. Will be added uppon the other - // entitys spacing_radius. So an entity with 2.0 and an entity with 3.0 will lead - // to that both entities will try to keep 5.0 units away from each other. + // entitys spacing_radius. So an entity with 2.0 and an entity with 3.0 will + // lead to that both entities will try to keep 5.0 units away from each + // other. pub fn spacing_radius(&self) -> f32 { - self.radius() + match self { - Body::QuadrupedSmall(body) => match body.species { - quadruped_small::Species::Rat => 0.0, - _ => 2.0, - }, - Body::QuadrupedLow(body) => match body.species { - quadruped_low::Species::Hakulaq => 0.0, + self.radius() + + match self { + Body::QuadrupedSmall(body) => match body.species { + quadruped_small::Species::Rat => 0.0, + _ => 2.0, + }, + Body::QuadrupedLow(body) => match body.species { + quadruped_low::Species::Hakulaq => 0.0, + _ => 2.0, + }, + Body::BipedSmall(body) => match body.species { + biped_small::Species::Husk => 3.0, + _ => 2.0, + }, _ => 2.0, } - Body::BipedSmall(body) => match body.species { - biped_small::Species::Husk => 3.0, - _ => 2.0, - } - _ => 2.0, - } } pub fn height(&self) -> f32 { self.dimensions().z } diff --git a/server/src/sys/agent.rs b/server/src/sys/agent.rs index fc6a6cb218..11481ea49d 100644 --- a/server/src/sys/agent.rs +++ b/server/src/sys/agent.rs @@ -3478,7 +3478,15 @@ impl<'a> AgentData<'a> { .actions .push(ControlAction::basic_input(InputKind::Ability(0))); // Move towards the target slowly - self.path_toward_target(agent, controller, tgt_data, read_data, true, false, Some(0.5)); + self.path_toward_target( + agent, + controller, + tgt_data, + read_data, + true, + false, + Some(0.5), + ); agent.action_state.timer += read_data.dt.0; } else if agent.action_state.timer < 6.0 && attack_data.angle < 90.0 @@ -4094,7 +4102,8 @@ impl<'a> AgentData<'a> { } self.pos.0 + PARTIAL_PATH_DIST - * (sep_vec * SEPARATION_BIAS + (tgt_data.pos.0 - self.pos.0) * (1.0 - SEPARATION_BIAS)) + * (sep_vec * SEPARATION_BIAS + + (tgt_data.pos.0 - self.pos.0) * (1.0 - SEPARATION_BIAS)) .try_normalized() .unwrap_or_else(Vec3::zero) } else if full_path {