1
0

Fixed entity chunking.

Sand simulator was off, sand in negative coords wouldn't fall properly

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1489 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-05-19 11:49:01 +00:00
parent 1e4aaa774a
commit 34fa53ca3a
5 changed files with 24 additions and 6 deletions

View File

@@ -49,9 +49,9 @@ void cFallingBlock::Tick(float a_Dt, cChunk & a_Chunk)
// GetWorld()->BroadcastTeleportEntity(*this); // Test position
int BlockX = (int)m_OriginalPosition.x;
int BlockX = m_OriginalPosition.x;
int BlockY = (int)(GetPosY() - 0.5);
int BlockZ = (int)m_OriginalPosition.z;
int BlockZ = m_OriginalPosition.z;
if (BlockY < 0)
{
@@ -83,6 +83,15 @@ void cFallingBlock::Tick(float a_Dt, cChunk & a_Chunk)
else if (!cSandSimulator::CanContinueFallThrough(BlockBelow))
{
// Fallen onto a solid block
/*
LOGD(
"Sand: Checked below at {%d, %d, %d} (rel {%d, %d, %d}), it's %s, finishing the fall.",
BlockX, BlockY, BlockZ,
BlockX - a_Chunk.GetPosX() * cChunkDef::Width, BlockY, BlockZ - a_Chunk.GetPosZ() * cChunkDef::Width,
ItemTypeToString(BlockBelow).c_str()
);
*/
cSandSimulator::FinishFalling(m_World, BlockX, BlockY + 1, BlockZ, m_BlockType, m_BlockMeta);
Destroy();
return;