diff options
author | Samuel Barney <samjbarney@gmail.com> | 2013-11-05 04:10:29 +0100 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2013-11-05 04:10:29 +0100 |
commit | b23047f47b19722354ce6fcb4fa671dd7e3528f2 (patch) | |
tree | 043f6f6a42d4ae3b16eb04752b03e40ff24dff21 | |
parent | Flowers, mushrooms and air are no longer collidable. (diff) | |
download | cuberite-b23047f47b19722354ce6fcb4fa671dd7e3528f2.tar cuberite-b23047f47b19722354ce6fcb4fa671dd7e3528f2.tar.gz cuberite-b23047f47b19722354ce6fcb4fa671dd7e3528f2.tar.bz2 cuberite-b23047f47b19722354ce6fcb4fa671dd7e3528f2.tar.lz cuberite-b23047f47b19722354ce6fcb4fa671dd7e3528f2.tar.xz cuberite-b23047f47b19722354ce6fcb4fa671dd7e3528f2.tar.zst cuberite-b23047f47b19722354ce6fcb4fa671dd7e3528f2.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Tracer.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/source/Tracer.cpp b/source/Tracer.cpp index 675905b11..d7a613891 100644 --- a/source/Tracer.cpp +++ b/source/Tracer.cpp @@ -225,24 +225,15 @@ 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 ;) - switch(BlockID) + if (g_BlockIsSolid[BlockID]) { - 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: + BlockHitPosition = pos; + int Normal = GetHitNormal(a_Start, End, pos ); + if(Normal > 0) { - BlockHitPosition = pos; - int Normal = GetHitNormal(a_Start, End, pos ); - if(Normal > 0) - { - HitNormal = m_NormalTable[Normal-1]; - } - return true; + HitNormal = m_NormalTable[Normal-1]; } + return true; } } return 0; |