mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed collision bugs
This commit is contained in:
parent
c2c5b9f5e7
commit
0d984a5671
@ -158,10 +158,14 @@ impl<'a> System<'a> for Sys {
|
|||||||
// Basic collision with terrain
|
// Basic collision with terrain
|
||||||
|
|
||||||
// Iterate through nearby blocks, prioritise closer ones
|
// Iterate through nearby blocks, prioritise closer ones
|
||||||
let near_iter = [0, -1, 1, -2, 2, 3].into_iter()
|
let near_iter = (0..5)
|
||||||
.map(move |k| [0, -1, 1, -2, 2].into_iter()
|
.map(move |dist| (-dist..=dist)
|
||||||
.map(move |j| [0, -1, 1, -2, 2].into_iter()
|
.map(move |x| (-dist..=dist)
|
||||||
.map(move |i| (*i, *j, *k))))
|
.map(move |y| (-dist..=dist)
|
||||||
|
.map(move |z| Vec3::new(x, y, z))
|
||||||
|
.filter(move |p| p.map(|e: i32| e.abs()).reduce_max() == dist)
|
||||||
|
.map(|p| p.into_tuple()))))
|
||||||
|
.flatten()
|
||||||
.flatten()
|
.flatten()
|
||||||
.flatten();
|
.flatten();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user