summaryrefslogtreecommitdiffstats
path: root/src/Simulator/VaporizeFluidSimulator.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-10-16 10:06:34 +0200
committerGitHub <noreply@github.com>2019-10-16 10:06:34 +0200
commit221cc4ec5cb6301743e947eaabed3fecedba796f (patch)
tree4e44c8bb7523e5d1d04468fc906ae24674c10abc /src/Simulator/VaporizeFluidSimulator.cpp
parentFixed crash in hopper while pulling items from blockentity above itself (#4412) (diff)
downloadcuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.gz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.bz2
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.lz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.xz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.zst
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.zip
Diffstat (limited to 'src/Simulator/VaporizeFluidSimulator.cpp')
-rw-r--r--src/Simulator/VaporizeFluidSimulator.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Simulator/VaporizeFluidSimulator.cpp b/src/Simulator/VaporizeFluidSimulator.cpp
index 32a55794d..441c0bb6c 100644
--- a/src/Simulator/VaporizeFluidSimulator.cpp
+++ b/src/Simulator/VaporizeFluidSimulator.cpp
@@ -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),