From ff098bc4bb998d820f42ad56a6b5256e00159cda Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 3 Nov 2012 18:07:49 +0100 Subject: [PATCH] Fix a bug in falling code where entities get stuck --- builtin/falling.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/falling.lua b/builtin/falling.lua index 4a7f416..3912727 100644 --- a/builtin/falling.lua +++ b/builtin/falling.lua @@ -111,6 +111,11 @@ function nodeupdate_single(p) end function nodeupdate(p) + -- Round p to prevent falling entities to get stuck + p.x = math.floor(p.x+0.5) + p.y = math.floor(p.y+0.5) + p.z = math.floor(p.z+0.5) + for x = -1,1 do for y = -1,1 do for z = -1,1 do