1
0

Refactored block-to-pickup conversion. (#4417)

This commit is contained in:
Mattes D
2019-10-16 10:06:34 +02:00
committed by GitHub
parent 241d97bbf9
commit 221cc4ec5c
121 changed files with 2496 additions and 1744 deletions

View File

@@ -28,15 +28,14 @@ void cVaporizeFluidSimulator::AddBlock(Vector3i a_Block, cChunk * a_Chunk)
{
return;
}
int RelX = a_Block.x - a_Chunk->GetPosX() * cChunkDef::Width;
int RelZ = a_Block.z - a_Chunk->GetPosZ() * cChunkDef::Width;
BLOCKTYPE BlockType = a_Chunk->GetBlock(RelX, a_Block.y, RelZ);
auto relPos = cChunkDef::AbsoluteToRelative(a_Block);
auto blockType = a_Chunk->GetBlock(relPos);
if (
(BlockType == m_FluidBlock) ||
(BlockType == m_StationaryFluidBlock)
(blockType == m_FluidBlock) ||
(blockType == m_StationaryFluidBlock)
)
{
a_Chunk->SetBlock(RelX, a_Block.y, RelZ, E_BLOCK_AIR, 0);
a_Chunk->SetBlock(relPos, E_BLOCK_AIR, 0);
World::GetBroadcastInterface(m_World).BroadcastSoundEffect(
"block.fire.extinguish",
Vector3d(a_Block),