From 875c2557c30aa5254c2ec3f4062ec463418c7d09 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 12 Apr 2014 00:01:15 +0200 Subject: Implemented the skeleton code for the beacon. There is no handling for the GUI. It can now check how big the pyramid is under the beacon. --- src/Chunk.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index fe9cd9b31..4366111ef 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1299,6 +1299,7 @@ void cChunk::CreateBlockEntities(void) BLOCKTYPE BlockType = cChunkDef::GetBlock(m_BlockTypes, x, y, z); switch (BlockType) { + case E_BLOCK_BEACON: case E_BLOCK_CHEST: case E_BLOCK_COMMAND_BLOCK: case E_BLOCK_DISPENSER: @@ -1429,6 +1430,7 @@ void cChunk::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, // If the new block is a block entity, create the entity object: switch (a_BlockType) { + case E_BLOCK_BEACON: case E_BLOCK_CHEST: case E_BLOCK_COMMAND_BLOCK: case E_BLOCK_DISPENSER: -- cgit v1.2.3 From 013da806ec20b62a742aded9a9d2b8131193f30d Mon Sep 17 00:00:00 2001 From: jfhumann Date: Fri, 18 Apr 2014 21:09:44 +0200 Subject: Did some static analysis, fixed some bugs and optimized a lot of code --- src/Chunk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index fe9cd9b31..acefd98ed 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -452,7 +452,7 @@ void cChunk::CollectMobCensus(cMobCensus& toFill) { cMonster& Monster = (cMonster&)(**itr); currentPosition = Monster.GetPosition(); - for (std::list::const_iterator itr2 = playerPositions.begin(); itr2 != playerPositions.end(); itr2 ++) + for (std::list::const_iterator itr2 = playerPositions.begin(); itr2 != playerPositions.end(); ++itr2) { toFill.CollectMob(Monster,*this,(currentPosition-**itr2).SqrLength()); } @@ -600,7 +600,7 @@ void cChunk::Tick(float a_Dt) delete ToDelete; continue; } - itr++; + ++itr; } // for itr - m_Entitites[] // If any entity moved out of the chunk, move it to the neighbor: -- cgit v1.2.3