fix: move collision_delay after step_recovery to prevent deadlock

collision_delay was placed before the walk_speed/step_recovery block,
causing step_recovery to never tick when collision_delay was active —
entities stayed permanently pre-empted at path_index=0.

Correct order: step_recovery (must tick every frame) before
collision_delay (only checked when entity is ready to move).
This commit is contained in:
2026-03-21 01:45:36 +00:00
parent b4804bee5a
commit e60d057276
+4 -4
View File
@@ -592,15 +592,15 @@ pub fn movement(
}
}
if let Some(path) = &ambulatory.current_path {
if ambulatory.path_index < path.len() {
let next_point = path[ambulatory.path_index];
if ambulatory.collision_delay > 0 {
ambulatory.collision_delay -= 1;
return;
}
if let Some(path) = &ambulatory.current_path {
if ambulatory.path_index < path.len() {
let next_point = path[ambulatory.path_index];
let current_crowded = occupancy.count_at(transform.translation) > 2;
let occupied = !current_crowded && occupancy.count_at(next_point) > 0;
if occupied {