From 960fcaa90c3ba4d57ff2205259471799e0418d12 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 16 Jul 2014 22:22:00 +0100 Subject: Fixed a bug with buckets * Additionally fixed cLineBlockTracer's EntryFace parameter when a block was hit on the first iteration along the projected line --- src/LineBlockTracer.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/LineBlockTracer.cpp') diff --git a/src/LineBlockTracer.cpp b/src/LineBlockTracer.cpp index b03652bab..2395aa43e 100644 --- a/src/LineBlockTracer.cpp +++ b/src/LineBlockTracer.cpp @@ -203,6 +203,15 @@ bool cLineBlockTracer::Item(cChunk * a_Chunk) m_Callbacks->OnNoChunk(); return false; } + + // Move to next block + if (!MoveToNextBlock()) + { + // We've reached the end + m_Callbacks->OnNoMoreHits(); + return true; + } + if (a_Chunk->IsValid()) { BLOCKTYPE BlockType; @@ -225,14 +234,6 @@ bool cLineBlockTracer::Item(cChunk * a_Chunk) } } - // Move to next block - if (!MoveToNextBlock()) - { - // We've reached the end - m_Callbacks->OnNoMoreHits(); - return true; - } - // Update the current chunk if (a_Chunk != NULL) { -- cgit v1.2.3