From 4ce1f9ee548b0a701bd7824d78fe5db1d66c78c4 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Sat, 11 May 2019 21:37:23 +0200 Subject: [PATCH 1/2] Temporary fix for falling into void Former-commit-id: 8e3d9c0c34e897f13cc60d5968f390ed0107dd76 --- common/src/sys/phys.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 0de3578576..191cf7e4ff 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -28,6 +28,12 @@ impl<'a> System<'a> for Sys { // Movement pos.0 += vel.0 * dt.0; + // Don't fall into the void + if pos.0.z < 0.0 { + pos.0.z = 0.0; + vel.0.z = 0.0; + } + // Basic collision with terrain let mut i = 0; while terrain From bdf241bf24610b1590e585abd614ed92dd978663 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Sat, 11 May 2019 21:48:05 +0200 Subject: [PATCH 2/2] Add TODO comment Former-commit-id: fdc9e6d65d9d534e238a6ba2d1c2e66f194d975e --- common/src/sys/phys.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 191cf7e4ff..2728ffe02e 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -29,6 +29,7 @@ impl<'a> System<'a> for Sys { pos.0 += vel.0 * dt.0; // Don't fall into the void + // TODO: This shouldn't be needed when we have proper physics and chunk loading if pos.0.z < 0.0 { pos.0.z = 0.0; vel.0.z = 0.0;