From 225c2fa9f6bc2ebffcc9160090482e6833a220ce Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 29 Jul 2020 01:18:59 +0100 Subject: Always use relative coordinates in AddBlock + Pass block, use relatives * Fixes everything immediately converting abs back to rel and getting block, when these data were already available --- src/ChunkMap.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/ChunkMap.cpp') diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 43253a91d..6b1ece612 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -227,7 +227,8 @@ void cChunkMap::WakeUpSimulators(Vector3i a_Block) { return; } - m_World->GetSimulatorManager()->WakeUp(a_Block, Chunk); + + m_World->GetSimulatorManager()->WakeUp(*Chunk, cChunkDef::AbsoluteToRelative(a_Block, Chunk->GetPos())); } @@ -644,7 +645,6 @@ void cChunkMap::SetBlock(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE BlockHandler(blockType)->OnBroken(ChunkInterface, *m_World, a_BlockPos, blockType, blockMeta); chunk->SetBlock(relPos, a_BlockType, a_BlockMeta); - m_World->GetSimulatorManager()->WakeUp(a_BlockPos, chunk); BlockHandler(a_BlockType)->OnPlaced(ChunkInterface, *m_World, a_BlockPos, a_BlockType, a_BlockMeta); } } @@ -867,7 +867,6 @@ bool cChunkMap::DigBlock(Vector3i a_BlockPos) } destChunk->SetBlock(relPos, E_BLOCK_AIR, 0); - m_World->GetSimulatorManager()->WakeUp(a_BlockPos, destChunk); } return true; } -- cgit v1.2.3