Implemented xoft's suggestions
I totally didn't copy this from the fire simulator... (I did, but I changed it quite a bit :P)
This commit is contained in:
parent
277b26b4c2
commit
a1d5d25525
@ -518,12 +518,29 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Push out entity.
|
// Push out entity.
|
||||||
|
BLOCKTYPE GotBlock;
|
||||||
|
|
||||||
if (NextChunk->GetBlock( RelBlockX + 1, BlockY, RelBlockZ ) == E_BLOCK_AIR) { NextPos.x += 0.2; }
|
static const struct
|
||||||
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; }
|
int x, y, z;
|
||||||
else if (NextChunk->GetBlock( RelBlockX, BlockY, RelBlockZ - 1 ) == E_BLOCK_AIR) { NextPos.z += -0.2; }
|
} gCrossCoords[] =
|
||||||
else { NextPos.y += 0.2; }
|
{
|
||||||
|
{ 1, 0, 0},
|
||||||
|
{-1, 0, 0},
|
||||||
|
{ 0, 0, 1},
|
||||||
|
{ 0, 0, -1},
|
||||||
|
} ;
|
||||||
|
|
||||||
|
for (int i = 0; i < ARRAYCOUNT(gCrossCoords); i++)
|
||||||
|
{
|
||||||
|
NextChunk->UnboundedRelGetBlockType(RelBlockX + gCrossCoords[i].x, BlockY, RelBlockZ + gCrossCoords[i].z, GotBlock);
|
||||||
|
if (GotBlock == E_BLOCK_AIR)
|
||||||
|
{
|
||||||
|
NextPos.x += gCrossCoords[i].x;
|
||||||
|
NextPos.z += gCrossCoords[i].z;
|
||||||
|
}
|
||||||
|
else { NextPos.y += 0.2; }
|
||||||
|
} // for i - gCrossCoords[]
|
||||||
|
|
||||||
m_bOnGround = true;
|
m_bOnGround = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user