summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2019-09-29 09:54:09 +0200
committerMattes D <github@xoft.cz>2019-09-29 13:42:29 +0200
commitba664340f3d170eac703c15a6f2c672c906ec939 (patch)
treec0981f65dc0526f073707ae325af5d0ef71ce08e
parentFixed MSVC warnings (#4400) (diff)
downloadcuberite-ba664340f3d170eac703c15a6f2c672c906ec939.tar
cuberite-ba664340f3d170eac703c15a6f2c672c906ec939.tar.gz
cuberite-ba664340f3d170eac703c15a6f2c672c906ec939.tar.bz2
cuberite-ba664340f3d170eac703c15a6f2c672c906ec939.tar.lz
cuberite-ba664340f3d170eac703c15a6f2c672c906ec939.tar.xz
cuberite-ba664340f3d170eac703c15a6f2c672c906ec939.tar.zst
cuberite-ba664340f3d170eac703c15a6f2c672c906ec939.zip
Diffstat (limited to '')
-rw-r--r--src/Chunk.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 9b9c881b7..a4a315bc0 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -1145,7 +1145,7 @@ int cChunk::GrowCactus(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
for (auto & Coord : Coords)
{
if (
- UnboundedRelGetBlockType(a_RelX + Coord.x, Top + 1, a_RelZ + Coord.z, BlockType) &&
+ UnboundedRelGetBlockType(a_RelX + Coord.x, Top + i, a_RelZ + Coord.z, BlockType) &&
(
cBlockInfo::IsSolid(BlockType) ||
(BlockType == E_BLOCK_LAVA) ||
@@ -1153,12 +1153,25 @@ int cChunk::GrowCactus(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
)
)
{
+ // Remove the cactus
+ GetWorld()->DigBlock(a_RelX + GetPosX() * cChunkDef::Width, Top + i, a_RelZ + GetPosZ() * cChunkDef::Width);
+
+ // Drop the cactus on the other side of the blocking block
+ cBlockHandler * Handler = BlockHandler(E_BLOCK_CACTUS);
+ cChunkInterface ChunkInterface(GetWorld()->GetChunkMap());
+ cBlockInServerPluginInterface PluginInterface(*GetWorld());
+ Handler->DropBlock(
+ ChunkInterface,
+ *GetWorld(),
+ PluginInterface,
+ nullptr,
+ a_RelX + GetPosX() * cChunkDef::Width - Coord.x,
+ Top + i,
+ a_RelZ + GetPosZ() * cChunkDef::Width - Coord.z
+ );
return false;
}
} // for i - Coords[]
- {
- GetWorld()->DigBlock(a_RelX + GetPosX() * cChunkDef::Width, Top + i, a_RelZ + GetPosZ() * cChunkDef::Width);
- }
}
else
{