summaryrefslogtreecommitdiffstats
path: root/source/Generating/MineShafts.cpp
diff options
context:
space:
mode:
authorDaniel O'Brien <marmot.daniel@gmail.com>2013-11-15 08:25:20 +0100
committerDaniel O'Brien <marmot.daniel@gmail.com>2013-11-15 08:25:20 +0100
commitaf17faac45f8ecbfc3af64231b65d66872af3301 (patch)
treea8864aef4d4a9036249170602164927b9ca99d58 /source/Generating/MineShafts.cpp
parentcProtocol add SendExperience() and debugging (diff)
parentMerge pull request #349 from SamJBarney/master (diff)
downloadcuberite-af17faac45f8ecbfc3af64231b65d66872af3301.tar
cuberite-af17faac45f8ecbfc3af64231b65d66872af3301.tar.gz
cuberite-af17faac45f8ecbfc3af64231b65d66872af3301.tar.bz2
cuberite-af17faac45f8ecbfc3af64231b65d66872af3301.tar.lz
cuberite-af17faac45f8ecbfc3af64231b65d66872af3301.tar.xz
cuberite-af17faac45f8ecbfc3af64231b65d66872af3301.tar.zst
cuberite-af17faac45f8ecbfc3af64231b65d66872af3301.zip
Diffstat (limited to 'source/Generating/MineShafts.cpp')
-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);
}
}