From 34fa53ca3a78fc32003c85256eeb623f96bc663f Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 19 May 2013 11:49:01 +0000 Subject: 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 --- source/FallingBlock.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/FallingBlock.cpp') diff --git a/source/FallingBlock.cpp b/source/FallingBlock.cpp index db5679454..f20abe3ba 100644 --- a/source/FallingBlock.cpp +++ b/source/FallingBlock.cpp @@ -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; -- cgit v1.2.3