mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
make scene interaction be targeted exactly on mining blocks (removing abnormal Empty labels), and don't reset position to None in the middle of mining.
This commit is contained in:
parent
ff91da8b52
commit
f20b5f0b49
@ -436,15 +436,12 @@ impl PlayState for SessionState {
|
||||
build_target.map(|bt| self.scene.set_select_pos(Some(bt.position_int())));
|
||||
} else {
|
||||
self.scene.set_select_pos(None);
|
||||
self.inputs.select_pos = entity_target.map(|et| et.position());
|
||||
}
|
||||
|
||||
// Throw out distance info, it will be useful in the future
|
||||
self.target_entity = entity_target.and_then(Target::entity);
|
||||
|
||||
// controller only wants 1 target
|
||||
// set default using entity_target as the selected_pos, and update per event
|
||||
self.inputs.select_pos = entity_target.map(|et| et.position());
|
||||
|
||||
macro_rules! entity_event_handler {
|
||||
($input: expr, $pressed: expr) => {
|
||||
let mut client = self.client.borrow_mut();
|
||||
|
@ -106,7 +106,7 @@ pub(super) fn targets_under_cursor(
|
||||
Ok(Some(_)) if player_cylinder.min_distance(*cam_pos + *cam_dir * (cam_dist + 0.01)) <= MAX_PICKUP_RANGE
|
||||
) {
|
||||
(
|
||||
Some(*cam_pos + *cam_dir * (cam_dist + 0.01)),
|
||||
Some(*cam_pos + *cam_dir * cam_dist),
|
||||
Some(*cam_pos + *cam_dir * (cam_dist - 0.01)),
|
||||
cam_ray
|
||||
)
|
||||
@ -129,7 +129,7 @@ pub(super) fn targets_under_cursor(
|
||||
(d, Ok(Some(_))) => Some(d),
|
||||
_ => None,
|
||||
}).min_by(|d1, d2| d1.partial_cmp(d2).unwrap())
|
||||
.unwrap_or(MAX_TARGET_RANGE);
|
||||
.unwrap_or(MAX_PICKUP_RANGE);
|
||||
|
||||
// See if ray hits entities
|
||||
// Currently treated as spheres
|
||||
|
Loading…
Reference in New Issue
Block a user