From bc1e236d547479833cc4f8d8218064cbdb9dfc0d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 18 Nov 2013 22:30:34 +0000 Subject: Redstone Megacommit [SEE DESC] + Updated BlockID - look for yourself * Improved button, repeater, lever, and comparator code -> simplification and splitting of some stuff from the redstone simulator file * Fixed buttons not breaking when in an invalid game state * Fixed QueueSetBlock -> improved (AGAIN) piston code + Rewrote redstone simulator Fixes: #57, #58, #205, and part of #131. Fixes FS issues: 281, 116, and 102 --- source/Chunk.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/Chunk.cpp') diff --git a/source/Chunk.cpp b/source/Chunk.cpp index 1c937c894..6e83d32ea 100644 --- a/source/Chunk.cpp +++ b/source/Chunk.cpp @@ -682,17 +682,17 @@ void cChunk::ProcessQueuedSetBlocks(void) Int64 CurrTick = m_World->GetWorldAge(); for (sSetBlockQueueVector::iterator itr = m_SetBlockQueue.begin(); itr != m_SetBlockQueue.end();) { - if (itr->m_Tick < CurrTick) + if (itr->m_Tick <= CurrTick) { - // Not yet - ++itr; - continue; + // Current world age is bigger than/equal to target world age - delay time reached + SetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta); + itr = m_SetBlockQueue.erase(itr); } else { - // Now is the time to set the block - SetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta); - itr = m_SetBlockQueue.erase(itr); + // Not yet + ++itr; + continue; } } // for itr - m_SetBlockQueue[] } -- cgit v1.2.3