Fix a crash.

This commit is contained in:
Nolan Darilek 2022-01-26 14:56:52 -06:00
parent cfee1d747a
commit 7d179b45f7

View File

@ -220,7 +220,7 @@ fn calculate_path(
.remove::<Speed>();
continue;
}
let map = map.single();
if let Ok(map) = map.get_single() {
let coordinates_clone = *coordinates;
let destination_clone = *destination;
let query_pipeline_clone = query_pipeline.clone();
@ -245,6 +245,7 @@ fn calculate_path(
.remove::<NoPath>();
}
}
}
fn poll_tasks(mut commands: Commands, mut query: Query<(Entity, &mut Calculating)>) {
for (entity, mut calculating) in query.iter_mut() {