mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
is_solid() detects both solid rock and sprites (e.g. mineable ore). when in build mode, would like to be able to still mine if user cursor is over a mineable ore. so need to properly cast the build ray to use opaque (not fillable) blocks to get the proper position, vs the mineable block which may be nearer
This commit is contained in:
parent
aa86c86cb6
commit
82f3c3c3e8
@ -217,6 +217,7 @@ impl Block {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filled blocks or sprites
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_solid(&self) -> bool {
|
pub fn is_solid(&self) -> bool {
|
||||||
self.get_sprite()
|
self.get_sprite()
|
||||||
|
@ -103,7 +103,7 @@ pub(super) fn targets_under_cursor(
|
|||||||
let (mine_pos, _, mine_cam_ray) = is_mining
|
let (mine_pos, _, mine_cam_ray) = is_mining
|
||||||
.then(|| find_pos(|b: Block| b.mine_tool().is_some()))
|
.then(|| find_pos(|b: Block| b.mine_tool().is_some()))
|
||||||
.unwrap_or((None, None, None));
|
.unwrap_or((None, None, None));
|
||||||
let (solid_pos, place_block_pos, solid_cam_ray) = find_pos(|b: Block| b.is_solid());
|
let (solid_pos, place_block_pos, solid_cam_ray) = find_pos(|b: Block| b.is_opaque());
|
||||||
|
|
||||||
// See if ray hits entities
|
// See if ray hits entities
|
||||||
// Don't cast through blocks, (hence why use shortest_cam_dist from non-entity
|
// Don't cast through blocks, (hence why use shortest_cam_dist from non-entity
|
||||||
|
Loading…
Reference in New Issue
Block a user