Skip to content

Commit

Permalink
Fix holding not being possible in-between pull cooldowns
Browse files Browse the repository at this point in the history
  • Loading branch information
janhohenheim committed Aug 15, 2024
1 parent a14335d commit 6b8d2c5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion src/interaction/hold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ fn hold(
continue;
};
let _transform = transform.compute_transform();
info!("Hold!");
let dt = time.delta_seconds();
//
// Unwrap cannot fail: rigid bodies are guarateed to have a
Expand Down
6 changes: 1 addition & 5 deletions src/interaction/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ fn find_object(
let actor_entity = trigger.entity();
let (origin, config, mut state, mut cooldown) = q_actor.get_mut(actor_entity).unwrap();

if !cooldown.right.finished() {
return;
}

let origin = origin.compute_transform();
let prop = find_prop_in_trace(&spatial_query, origin, config)
.or_else(|| find_prop_in_cone(&spatial_query, origin, config, &q_transform));
Expand Down Expand Up @@ -64,7 +60,7 @@ fn find_object(
cooldown.hold();
info!("Start Holding");
*state = AvianPickupActorState::Holding(prop.entity);
} else {
} else if cooldown.right.finished() {
let object_transform = object_transform.compute_transform();
let direction = origin.translation - object_transform.translation;
let mass_adjustment = adjust_impulse_for_mass(mass);
Expand Down

0 comments on commit 6b8d2c5

Please sign in to comment.