From 51963990bc0cbbbca388b2ed015fd64ff6492d7b Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 18 Sep 2023 23:25:18 -0500 Subject: fix entities not always being despawned after merge --- azalea-physics/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'azalea-physics/src/lib.rs') diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index 52bb4b9c..5fe7d218 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -16,6 +16,7 @@ use bevy_ecs::{ query::With, schedule::{IntoSystemConfigs, SystemSet}, system::{Query, Res}, + world::Mut, }; use collision::{move_colliding, MoverType}; @@ -53,7 +54,7 @@ fn travel( >, instance_container: Res, ) { - for (mut physics, direction, mut position, sprinting, attributes, world_name) in &mut query { + for (mut physics, direction, position, sprinting, attributes, world_name) in &mut query { let world_lock = instance_container .get(world_name) .expect("All entities should be in a valid world"); @@ -93,7 +94,7 @@ fn travel( &world, &mut physics, &direction, - &mut position, + position, attributes, sprinting.map(|s| **s).unwrap_or(false), ); @@ -222,7 +223,8 @@ fn handle_relative_friction_and_calculate_movement( world: &Instance, physics: &mut Physics, direction: &LookDirection, - position: &mut Position, + // this is kept as a Mut for bevy change tracking + position: Mut, attributes: &Attributes, is_sprinting: bool, ) -> Vec3 { -- cgit v1.2.3