Will giving explicit ownership to this function help? Doesn't seem to.
This commit is contained in:
parent
698f12d9bd
commit
65e7c0f870
|
@ -153,12 +153,12 @@ impl ComponentSetOption<ColliderPosition> 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<Path> {
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user