Remove printlns.

This commit is contained in:
Nolan Darilek 2021-07-28 09:39:10 -05:00
parent 7fe808b2a1
commit 5664f9e646

View File

@ -188,7 +188,6 @@ fn calculate_path(
) {
for (entity, destination, coordinates, shape) in query.iter() {
if coordinates.i32() == **destination {
println!("Removing path1: {:?}", entity);
commands
.entity(entity)
.remove::<Path>()
@ -204,7 +203,6 @@ fn calculate_path(
let map_clone = map.clone();
let shape_clone = shape.clone();
let collider_set: StaticColliderComponentsSet = (&collider_query, &obstructions).into();
println!("Spawning pathfinding task for {:?}", entity);
let task = pool.spawn(async move {
find_path_for_shape(
entity,
@ -221,22 +219,18 @@ fn calculate_path(
.insert(Calculating(task))
.remove::<Path>()
.remove::<NoPath>();
println!("Inserted");
}
}
}
fn poll_tasks(mut commands: Commands, mut query: Query<(Entity, &mut Calculating)>) {
for (entity, mut calculating) in query.iter_mut() {
println!("Got a calculating task for {:?}", entity);
if let Some(result) = future::block_on(future::poll_once(&mut **calculating)) {
println!("Got a result, setting and returning");
if let Some(path) = result {
commands.entity(entity).insert(path);
} else {
commands.entity(entity).insert(NoPath);
}
println!("Removing calculation task");
commands.entity(entity).remove::<Calculating>();
}
}
@ -286,7 +280,6 @@ fn negotiate_path(
continue;
}
} else {
println!("Removing path2");
commands.entity(entity).remove::<Path>();
velocity.linvel = Vec2::ZERO.into();
}
@ -308,7 +301,6 @@ fn negotiate_path(
direction *= **speed;
velocity.linvel = direction.into();
} else {
println!("Removing path3");
velocity.linvel = Vec2::ZERO.into();
commands
.entity(entity)
@ -323,7 +315,6 @@ fn remove_calculating(
query: Query<Entity, (Changed<Destination>, With<Calculating>)>,
) {
for entity in query.iter() {
println!("Probably shouldn't happen");
commands.entity(entity).remove::<Calculating>();
}
}