summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-09-10 23:51:07 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-09-10 23:51:07 +0200
commit010bc94a342770e96a005353d23d7ebf6cc5aa39 (patch)
treef5965c887d7bb69939a2693d823b0458ce923269 /source
parentPumpkin and JackOLantern support (diff)
downloadcuberite-010bc94a342770e96a005353d23d7ebf6cc5aa39.tar
cuberite-010bc94a342770e96a005353d23d7ebf6cc5aa39.tar.gz
cuberite-010bc94a342770e96a005353d23d7ebf6cc5aa39.tar.bz2
cuberite-010bc94a342770e96a005353d23d7ebf6cc5aa39.tar.lz
cuberite-010bc94a342770e96a005353d23d7ebf6cc5aa39.tar.xz
cuberite-010bc94a342770e96a005353d23d7ebf6cc5aa39.tar.zst
cuberite-010bc94a342770e96a005353d23d7ebf6cc5aa39.zip
Diffstat (limited to 'source')
-rw-r--r--source/Entities/Entity.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/Entities/Entity.cpp b/source/Entities/Entity.cpp
index 4066e81ab..0aaa2e899 100644
--- a/source/Entities/Entity.cpp
+++ b/source/Entities/Entity.cpp
@@ -491,8 +491,15 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
if ((BlockY >= cChunkDef::Height) || (BlockY < 0))
{
// Outside of the world
- // TODO: Current speed should still be added to the entity position
- // Otherwise TNT explosions in the void will still effect the bottommost layers of the world
+
+ cChunk * NextChunk = a_Chunk.GetNeighborChunk(BlockX,BlockZ);
+ // See if we can commit our changes. If not, we will discard them.
+ if (NextChunk != NULL)
+ {
+ SetSpeed(NextSpeed);
+ NextPos += (NextSpeed * a_Dt);
+ SetPosition(NextPos);
+ }
return;
}