fix
This commit is contained in:
@@ -24,7 +24,6 @@ pub fn task_executor_system(
|
||||
mut commands: Commands,
|
||||
tilemap: Res<TileMap>,
|
||||
chunk_map: Res<ChunkMap>,
|
||||
behaviour_registry: Res<EntityBehaviourRegistry>,
|
||||
mut rng_q: Query<&mut WyRand, With<GlobalRng>>,
|
||||
mut tick: Local<u32>,
|
||||
mut query: Query<(
|
||||
@@ -53,12 +52,13 @@ pub fn task_executor_system(
|
||||
let origin = transform.translation.as_ivec3();
|
||||
let behaviour = EntityBehaviourRegistry::global_get(entity_type.0);
|
||||
|
||||
// If queue empty, assign Idle with Gaussian params from TOML
|
||||
if queue.is_empty() {
|
||||
queue.push(Task::Idle {
|
||||
origin,
|
||||
sigma_world: behaviour.idle.sigma_world,
|
||||
state: IdleState::Picking,
|
||||
state: IdleState::Picking {
|
||||
retry_after_tick: 0,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -138,12 +138,13 @@ pub fn task_executor_system(
|
||||
});
|
||||
}
|
||||
|
||||
// If terminal task completed, push Idle with Gaussian params
|
||||
if completed_task.is_terminal() && queue.is_empty() {
|
||||
queue.push(Task::Idle {
|
||||
origin,
|
||||
sigma_world: behaviour.idle.sigma_world,
|
||||
state: IdleState::Picking,
|
||||
state: IdleState::Picking {
|
||||
retry_after_tick: 0,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user