summaryrefslogtreecommitdiffstats
path: root/source/Generating/MineShafts.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-14 15:37:09 +0100
committermadmaxoft <github@xoft.cz>2013-11-14 15:37:09 +0100
commit082573771f469cfaef03d22e4281f207beef36c8 (patch)
treeac17ff48476205939d8b943eee2a7667c4b66ff1 /source/Generating/MineShafts.cpp
parentMerge pull request #344 from marmot21/playerxp (diff)
downloadcuberite-082573771f469cfaef03d22e4281f207beef36c8.tar
cuberite-082573771f469cfaef03d22e4281f207beef36c8.tar.gz
cuberite-082573771f469cfaef03d22e4281f207beef36c8.tar.bz2
cuberite-082573771f469cfaef03d22e4281f207beef36c8.tar.lz
cuberite-082573771f469cfaef03d22e4281f207beef36c8.tar.xz
cuberite-082573771f469cfaef03d22e4281f207beef36c8.tar.zst
cuberite-082573771f469cfaef03d22e4281f207beef36c8.zip
Diffstat (limited to '')
-rw-r--r--source/Generating/MineShafts.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/Generating/MineShafts.cpp b/source/Generating/MineShafts.cpp
index 3131b5429..159e6b4ea 100644
--- a/source/Generating/MineShafts.cpp
+++ b/source/Generating/MineShafts.cpp
@@ -794,12 +794,12 @@ void cMineShaftCorridor::PlaceChest(cChunkDesc & a_ChunkDesc)
)
{
a_ChunkDesc.SetBlockTypeMeta(x, m_BoundingBox.p1.y + 1, z, E_BLOCK_CHEST, Meta);
- cChestEntity * ChestEntity = new cChestEntity(BlockX + x, m_BoundingBox.p1.y + 1, BlockZ + z);
+ cChestEntity * ChestEntity = (cChestEntity *)a_ChunkDesc.GetBlockEntity(x, m_BoundingBox.p1.y + 1, z);
+ ASSERT((ChestEntity != NULL) && (ChestEntity->GetBlockType() == E_BLOCK_CHEST));
cNoise Noise(a_ChunkDesc.GetChunkX() ^ a_ChunkDesc.GetChunkZ());
int NumSlots = 3 + ((Noise.IntNoise3DInt(x, m_BoundingBox.p1.y, z) / 11) % 4);
int Seed = Noise.IntNoise2DInt(x, z);
ChestEntity->GetContents().GenerateRandomLootWithBooks(LootProbab, ARRAYCOUNT(LootProbab), NumSlots, Seed);
- a_ChunkDesc.AddBlockEntity(ChestEntity);
}
}