diff options
| author | mat <git@matdoes.dev> | 2023-09-18 23:25:18 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-09-18 23:25:22 -0500 |
| commit | 51963990bc0cbbbca388b2ed015fd64ff6492d7b (patch) | |
| tree | a06f6b78f6f3954c230a9c57050467bb20ebe232 /azalea-physics/src/lib.rs | |
| parent | e6941b6a24deed617d09c6e08ba65278bb3bcf25 (diff) | |
| download | azalea-drasl-51963990bc0cbbbca388b2ed015fd64ff6492d7b.tar.xz | |
fix entities not always being despawned after merge
Diffstat (limited to 'azalea-physics/src/lib.rs')
| -rw-r--r-- | azalea-physics/src/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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<InstanceContainer>, ) { - 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<Position>, attributes: &Attributes, is_sprinting: bool, ) -> Vec3 { |
