fix
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user