From 502935c061ea913180f0a77a7406f5292e697c79 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 6 Apr 2013 21:21:57 +0000 Subject: Mineshafts: Added random loot to generated chests and fixed chest direction git-svn-id: http://mc-server.googlecode.com/svn/trunk@1365 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Chunk.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/Chunk.cpp') diff --git a/source/Chunk.cpp b/source/Chunk.cpp index 9856e67b3..0a7b39f12 100644 --- a/source/Chunk.cpp +++ b/source/Chunk.cpp @@ -306,6 +306,12 @@ void cChunk::SetAllData( } std::swap(a_BlockEntities, m_BlockEntities); + // Set all block entities' World variable: + for (cBlockEntityList::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr) + { + (*itr)->SetWorld(m_World); + } + // Create block entities that the loader didn't load; fill them with defaults CreateBlockEntities(); @@ -1015,8 +1021,8 @@ void cChunk::CreateBlockEntities(void) { for (int y = 0; y < Height; y++) { - ENUM_BLOCK_ID BlockType = (ENUM_BLOCK_ID)cChunkDef::GetBlock(m_BlockTypes, x, y, z); - switch ( BlockType ) + BLOCKTYPE BlockType = cChunkDef::GetBlock(m_BlockTypes, x, y, z); + switch (BlockType) { case E_BLOCK_CHEST: { -- cgit v1.2.3