1
0

Fixed a bug with buckets

* Additionally fixed cLineBlockTracer's EntryFace parameter when a block
was hit on the first iteration along the projected line
This commit is contained in:
Tiger Wang 2014-07-16 22:22:00 +01:00
parent 9194438fb5
commit 960fcaa90c
2 changed files with 10 additions and 9 deletions

View File

@ -215,7 +215,7 @@ public:
} Callbacks;
cLineBlockTracer Tracer(*a_World, Callbacks);
Vector3d Start(a_Player->GetEyePosition() + a_Player->GetLookVector());
Vector3d Start(a_Player->GetEyePosition());
Vector3d End(a_Player->GetEyePosition() + a_Player->GetLookVector() * 5);
// cTracer::Trace returns true when whole line was traversed. By returning true when we hit something, we ensure that this never happens if liquid could be placed

View File

@ -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)
{