From b5a2c6667ac0845d17a709cc436afb570079a9a7 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 3 Oct 2014 21:32:41 +0100 Subject: Improved furnaces * Fixed progress bar on 1.8 * Fixed bugs * Improved code * Fixes #1068 * Fixes #1070 --- src/Chunk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 96b8eda4e..88ee9ba31 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -333,7 +333,7 @@ void cChunk::SetAllData(cSetChunkData & a_SetChunkData) { BLOCKTYPE EntityBlockType = (*itr)->GetBlockType(); BLOCKTYPE WorldBlockType = GetBlock((*itr)->GetRelX(), (*itr)->GetPosY(), (*itr)->GetRelZ()); - ASSERT(EntityBlockType == WorldBlockType); + ASSERT((EntityBlockType == E_BLOCK_FURNACE) ? ((EntityBlockType == E_BLOCK_FURNACE) || (EntityBlockType == E_BLOCK_LIT_FURNACE)) : (WorldBlockType == EntityBlockType)); } // for itr - m_BlockEntities #endif // _DEBUG -- cgit v1.2.3 From eeb580a74e48829908c303f8145802bfa1805c68 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 15 Oct 2014 19:01:55 +0200 Subject: Functions in cPluginManager get references instead of pointers. --- src/Chunk.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 96b8eda4e..84da1fe12 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -119,7 +119,7 @@ cChunk::cChunk( cChunk::~cChunk() { - cPluginManager::Get()->CallHookChunkUnloaded(m_World, m_PosX, m_PosZ); + cPluginManager::Get()->CallHookChunkUnloaded(*m_World, m_PosX, m_PosZ); // LOGINFO("### delete cChunk() (%i, %i) from %p, thread 0x%x ###", m_PosX, m_PosZ, this, GetCurrentThreadId()); @@ -1750,11 +1750,11 @@ void cChunk::SetAreaBiome(int a_MinRelX, int a_MaxRelX, int a_MinRelZ, int a_Max -void cChunk::CollectPickupsByPlayer(cPlayer * a_Player) +void cChunk::CollectPickupsByPlayer(cPlayer & a_Player) { - double PosX = a_Player->GetPosX(); - double PosY = a_Player->GetPosY(); - double PosZ = a_Player->GetPosZ(); + double PosX = a_Player.GetPosX(); + double PosY = a_Player.GetPosY(); + double PosZ = a_Player.GetPosZ(); for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr) { -- cgit v1.2.3 From 6a22b63473d465027b8d328d2ab621c596d1ee84 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 18 Oct 2014 19:54:34 +0100 Subject: Furnaces now update their block entity type Therefore improving cChunk's variable boundary checking. --- src/Chunk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 88ee9ba31..98c8bc66a 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -333,7 +333,7 @@ void cChunk::SetAllData(cSetChunkData & a_SetChunkData) { BLOCKTYPE EntityBlockType = (*itr)->GetBlockType(); BLOCKTYPE WorldBlockType = GetBlock((*itr)->GetRelX(), (*itr)->GetPosY(), (*itr)->GetRelZ()); - ASSERT((EntityBlockType == E_BLOCK_FURNACE) ? ((EntityBlockType == E_BLOCK_FURNACE) || (EntityBlockType == E_BLOCK_LIT_FURNACE)) : (WorldBlockType == EntityBlockType)); + ASSERT(WorldBlockType == EntityBlockType); } // for itr - m_BlockEntities #endif // _DEBUG -- cgit v1.2.3 From 3082f0d0460d84500259c854d9bf3b1997827d90 Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Sun, 19 Oct 2014 15:11:53 +0200 Subject: Fixed error with non-const function --- src/Chunk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index d03e0bf21..7d6d88b26 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -2614,7 +2614,7 @@ BLOCKTYPE cChunk::GetBlock(int a_RelX, int a_RelY, int a_RelZ) const -void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) +void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const { a_BlockType = GetBlock(a_RelX, a_RelY, a_RelZ); a_BlockMeta = m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ); -- cgit v1.2.3