1
0

Entities now maintain speed outside of world

This commit is contained in:
Tiger Wang 2013-09-10 22:51:07 +01:00
parent 3d7813fdb2
commit 010bc94a34

View File

@ -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;
}