summaryrefslogtreecommitdiffstats
path: root/src/Simulator/SandSimulator.cpp
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2017-05-02 13:16:59 +0200
committerLukas Pioch <lukas@zgow.de>2017-05-08 06:31:45 +0200
commit5580d558a5ede21f856d7b77c3f1ab99a4f088c4 (patch)
tree24772f12098aac2d4576ca6a46bbec47a188f282 /src/Simulator/SandSimulator.cpp
parentCorrected brewingstand and added support for fuel (diff)
downloadcuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.gz
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.bz2
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.lz
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.xz
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.tar.zst
cuberite-5580d558a5ede21f856d7b77c3f1ab99a4f088c4.zip
Diffstat (limited to 'src/Simulator/SandSimulator.cpp')
-rw-r--r--src/Simulator/SandSimulator.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Simulator/SandSimulator.cpp b/src/Simulator/SandSimulator.cpp
index 59990cea3..63fd8477d 100644
--- a/src/Simulator/SandSimulator.cpp
+++ b/src/Simulator/SandSimulator.cpp
@@ -62,7 +62,12 @@ void cSandSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX,
);
*/
cFallingBlock * FallingBlock = new cFallingBlock(Pos, BlockType, a_Chunk->GetMeta(itr->x, itr->y, itr->z));
- FallingBlock->Initialize(m_World);
+ if (!FallingBlock->Initialize(m_World))
+ {
+ delete FallingBlock;
+ FallingBlock = nullptr;
+ continue;
+ }
a_Chunk->SetBlock(itr->x, itr->y, itr->z, E_BLOCK_AIR, 0);
}
}