diff options
author | Samuel Barney <samjbarney@gmail.com> | 2013-11-05 01:14:49 +0100 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2013-11-05 01:14:49 +0100 |
commit | 96ef6084aedb24821a584bb864f704c98915bf2e (patch) | |
tree | 0db7151c538f5ee7ed3ea249f628df091fe5b46f /source/Tracer.cpp | |
parent | Protocol 1.7: Added client status packet. (diff) | |
download | cuberite-96ef6084aedb24821a584bb864f704c98915bf2e.tar cuberite-96ef6084aedb24821a584bb864f704c98915bf2e.tar.gz cuberite-96ef6084aedb24821a584bb864f704c98915bf2e.tar.bz2 cuberite-96ef6084aedb24821a584bb864f704c98915bf2e.tar.lz cuberite-96ef6084aedb24821a584bb864f704c98915bf2e.tar.xz cuberite-96ef6084aedb24821a584bb864f704c98915bf2e.tar.zst cuberite-96ef6084aedb24821a584bb864f704c98915bf2e.zip |
Diffstat (limited to 'source/Tracer.cpp')
-rw-r--r-- | source/Tracer.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/source/Tracer.cpp b/source/Tracer.cpp index 42f1ae5dd..675905b11 100644 --- a/source/Tracer.cpp +++ b/source/Tracer.cpp @@ -225,15 +225,24 @@ int cTracer::Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int BLOCKTYPE BlockID = m_World->GetBlock(pos.x, pos.y, pos.z); // No collision with water ;) - if ((BlockID != E_BLOCK_AIR) || IsBlockWater(BlockID)) // _X 2013_03_29: Why is the IsBlockWater condition here? water equals air? + switch(BlockID) { - BlockHitPosition = pos; - int Normal = GetHitNormal(a_Start, End, pos ); - if(Normal > 0) + case E_BLOCK_AIR: + case E_BLOCK_YELLOW_FLOWER: + case E_BLOCK_RED_ROSE: + case E_BLOCK_RED_MUSHROOM: + case E_BLOCK_BROWN_MUSHROOM: + break; + default: { - HitNormal = m_NormalTable[Normal-1]; + BlockHitPosition = pos; + int Normal = GetHitNormal(a_Start, End, pos ); + if(Normal > 0) + { + HitNormal = m_NormalTable[Normal-1]; + } + return true; } - return 1; } } return 0; |