diff --git a/src/pathfinding.rs b/src/pathfinding.rs index 7112058..a962a6b 100644 --- a/src/pathfinding.rs +++ b/src/pathfinding.rs @@ -153,12 +153,12 @@ impl ComponentSetOption for StaticColliderComponentsSet { fn find_path_for_shape( initiator: Entity, - start: &dyn PointLike, - destination: &dyn PointLike, - query_pipeline: &QueryPipeline, - map: &Map, + start: Coordinates, + destination: Destination, + query_pipeline: QueryPipeline, + map: Map, collider_set: StaticColliderComponentsSet, - shape: &ColliderShape, + shape: ColliderShape, ) -> Option { let path = astar( &start.i32(), @@ -171,7 +171,7 @@ fn find_path_for_shape( query_pipeline.intersections_with_shape( &collider_set, &shape_pos, - &**shape, + &*shape, InteractionGroups::all(), Some(&|v| v.entity() != initiator), |_handle| { @@ -186,7 +186,7 @@ fn find_path_for_shape( } successors }, - |p| (p.distance_squared(destination) * 100.) as u32, + |p| (p.distance_squared(&destination) * 100.) as u32, |p| *p == destination.i32(), ); if let Some(path) = path { @@ -229,12 +229,12 @@ fn calculate_path( let task = pool.spawn(async move { find_path_for_shape( entity, - &coordinates_clone, - &destination_clone, - &query_pipeline_clone, - &map_clone, + coordinates_clone, + destination_clone, + query_pipeline_clone, + map_clone, collider_set, - &shape_clone, + **shape_clone, ) }); commands