diff --git a/src/pathfinding.rs b/src/pathfinding.rs index 4079e66..a64698a 100644 --- a/src/pathfinding.rs +++ b/src/pathfinding.rs @@ -240,6 +240,7 @@ fn calculate_path( }); commands .entity(entity) + .remove::() .insert(Calculating(task)) .remove::() .remove::(); @@ -324,15 +325,6 @@ fn negotiate_path( } } -fn remove_calculating( - mut commands: Commands, - query: Query, With)>, -) { - for entity in query.iter() { - commands.entity(entity).remove::(); - } -} - pub struct PathfindingPlugin; impl Plugin for PathfindingPlugin { @@ -340,7 +332,6 @@ impl Plugin for PathfindingPlugin { app.add_system(calculate_path) .add_system_to_stage(CoreStage::PostUpdate, remove_destination) .add_system(poll_tasks) - .add_system(negotiate_path) - .add_system_to_stage(CoreStage::PostUpdate, remove_calculating); + .add_system(negotiate_path); } }