This commit is contained in:
2026-03-22 11:50:53 +00:00
parent 2f456f80b8
commit cb5b18008d
10 changed files with 79 additions and 66 deletions
+6 -5
View File
@@ -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,
},
});
}
}