diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-09-04 18:52:15 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-09-04 18:52:15 +0200 |
commit | 3300cfe491297b284096d976c83fb7a1107162e9 (patch) | |
tree | f8fd41bc8a64298b2f1b439d4b3d0f10d2ae812c /source | |
parent | Fixed inconsistent meta naming (diff) | |
download | cuberite-3300cfe491297b284096d976c83fb7a1107162e9.tar cuberite-3300cfe491297b284096d976c83fb7a1107162e9.tar.gz cuberite-3300cfe491297b284096d976c83fb7a1107162e9.tar.bz2 cuberite-3300cfe491297b284096d976c83fb7a1107162e9.tar.lz cuberite-3300cfe491297b284096d976c83fb7a1107162e9.tar.xz cuberite-3300cfe491297b284096d976c83fb7a1107162e9.tar.zst cuberite-3300cfe491297b284096d976c83fb7a1107162e9.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Entities/Entity.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/Entities/Entity.cpp b/source/Entities/Entity.cpp index 56fd36a05..7e118c74e 100644 --- a/source/Entities/Entity.cpp +++ b/source/Entities/Entity.cpp @@ -517,7 +517,14 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk) } else { - // Push out entity. + //Push out entity. + + if (NextChunk->GetBlock( RelBlockX + 1, BlockY, RelBlockZ ) == E_BLOCK_AIR) { NextPos.x += 0.2; } + else if (NextChunk->GetBlock( RelBlockX - 1, BlockY, RelBlockZ ) == E_BLOCK_AIR) { NextPos.x += -0.2; } + else if (NextChunk->GetBlock( RelBlockX, BlockY, RelBlockZ + 1 ) == E_BLOCK_AIR) { NextPos.z += 0.2; } + else if (NextChunk->GetBlock( RelBlockX, BlockY, RelBlockZ - 1 ) == E_BLOCK_AIR) { NextPos.z += -0.2; } + else { NextPos.y += 0.2; } + m_bOnGround = true; NextPos.y += 0.2; LOGD("Entity #%d (%s) is inside a block at {%d, %d, %d}", |