diff options
author | madmaxoft <github@xoft.cz> | 2013-11-14 15:37:09 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-11-14 15:37:09 +0100 |
commit | 082573771f469cfaef03d22e4281f207beef36c8 (patch) | |
tree | ac17ff48476205939d8b943eee2a7667c4b66ff1 /source/Generating/MineShafts.cpp | |
parent | Merge pull request #344 from marmot21/playerxp (diff) | |
download | cuberite-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 'source/Generating/MineShafts.cpp')
-rw-r--r-- | source/Generating/MineShafts.cpp | 4 |
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); } } |