This commit is contained in:
2026-03-22 15:07:05 +00:00
parent 5a830f46f9
commit 3b9b2d9c88
2 changed files with 109 additions and 71 deletions
+2 -1
View File
@@ -180,7 +180,8 @@ pub fn task_executor_system(
let chopper_pos = transform.translation.truncate(); // XY only
let trunk_xy = Vec2::new(trunk_pos.x as f32, trunk_pos.y as f32);
let mut fall_dir = (trunk_xy - chopper_pos).normalize_or_zero();
// If dorf is standing on the trunk (distance ~0), fall direction is arbitrary
// If dorf is standing on the trunk (distance ~0), normalize_or_zero returns ZERO.
// Safe to use == here because normalize_or_zero produces exact zero components.
if fall_dir == Vec2::ZERO {
fall_dir = Vec2::new(1.0, 0.0); // default: fall east
}