Fix a bug in falling code where entities get stuck

This commit is contained in:
PilzAdam 2012-11-03 18:07:49 +01:00 committed by Nils Dagsson Moskopp
parent 4742943383
commit ff098bc4bb
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 5 additions and 0 deletions

View File

@ -111,6 +111,11 @@ function nodeupdate_single(p)
end end
function nodeupdate(p) 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 x = -1,1 do
for y = -1,1 do for y = -1,1 do
for z = -1,1 do for z = -1,1 do