From 008c1cdaf436dec2d7a4a925c6a600570594d6a2 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 14 Aug 2014 01:03:30 +0200 Subject: CheckBasicStyle checks the src folder as well. --- src/Chunk.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index a79a485a6..7bdf4196d 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -579,7 +579,7 @@ void cChunk::Tick(float a_Dt) } for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end();) - { + { if (!((*itr)->IsMob())) // Mobs are ticked inside cWorld::TickMobs() (as we don't have to tick them if they are far away from players) { // Tick all entities in this chunk (except mobs): @@ -594,17 +594,19 @@ void cChunk::Tick(float a_Dt) itr = m_Entities.erase(itr); delete ToDelete; } - else if ((*itr)->IsWorldTravellingFrom(m_World)) // Remove all entities that are travelling to another world: + else if ((*itr)->IsWorldTravellingFrom(m_World)) { + // Remove all entities that are travelling to another world MarkDirty(); (*itr)->SetWorldTravellingFrom(NULL); itr = m_Entities.erase(itr); } - else if ( // If any entity moved out of the chunk, move it to the neighbor: + else if ( ((*itr)->GetChunkX() != m_PosX) || ((*itr)->GetChunkZ() != m_PosZ) ) { + // The entity moved out of the chunk, move it to the neighbor MarkDirty(); MoveEntityToNewChunk(*itr); itr = m_Entities.erase(itr); @@ -885,14 +887,14 @@ void cChunk::ApplyWeatherToTop() SetBlock(X, Height, Z, E_BLOCK_ICE, 0); } else if ( - (m_World->IsDeepSnowEnabled()) && - ( - (TopBlock == E_BLOCK_RED_ROSE) || - (TopBlock == E_BLOCK_YELLOW_FLOWER) || - (TopBlock == E_BLOCK_RED_MUSHROOM) || - (TopBlock == E_BLOCK_BROWN_MUSHROOM) - ) + (m_World->IsDeepSnowEnabled()) && + ( + (TopBlock == E_BLOCK_RED_ROSE) || + (TopBlock == E_BLOCK_YELLOW_FLOWER) || + (TopBlock == E_BLOCK_RED_MUSHROOM) || + (TopBlock == E_BLOCK_BROWN_MUSHROOM) ) + ) { SetBlock(X, Height, Z, E_BLOCK_SNOW, 0); } @@ -2142,10 +2144,14 @@ bool cChunk::DoWithRedstonePoweredEntityAt(int a_BlockX, int a_BlockY, int a_Blo case E_BLOCK_DROPPER: case E_BLOCK_DISPENSER: case E_BLOCK_NOTE_BLOCK: + { break; + } default: + { // There is a block entity here, but of different type. No other block entity can be here, so we can safely bail out return false; + } } if (a_Callback.Item((cRedstonePoweredEntity *)*itr)) -- cgit v1.2.3 From b5ffe06f884221f98407910bdd30baf533d84970 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 19 Aug 2014 22:14:37 +0200 Subject: Code formatting fixes. --- src/Chunk.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 7bdf4196d..116c0f3a0 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1,3 +1,4 @@ + #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #ifndef _WIN32 -- cgit v1.2.3