summaryrefslogtreecommitdiffstats
path: root/source/cTracer.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cTracer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/cTracer.cpp b/source/cTracer.cpp
index 28e5c49b5..2dce341b4 100644
--- a/source/cTracer.cpp
+++ b/source/cTracer.cpp
@@ -9,6 +9,8 @@
#include "cMCLogger.h"
#include "cEntity.h"
+#include "Defines.h"
+
#ifndef _WIN32
#include <stdlib.h> // abs()
#endif
@@ -209,7 +211,8 @@ int cTracer::Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int
}
char BlockID = m_World->GetBlock( pos->x, pos->y, pos->z );
- if ( BlockID != E_BLOCK_AIR )
+ //No collision with water ;)
+ if ( BlockID != E_BLOCK_AIR || IsBlockWater(BlockID))
{
*BlockHitPosition = pos;
int Normal = GetHitNormal(a_Start, End, *pos );
@@ -280,7 +283,7 @@ int cTracer::GetHitNormal(const Vector3f & start, const Vector3f & end, const Ve
Vector3i SmallBlockPos = a_BlockPos;
char BlockID = m_World->GetBlock( a_BlockPos.x, a_BlockPos.y, a_BlockPos.z );
- if( BlockID == E_BLOCK_AIR )
+ if( BlockID == E_BLOCK_AIR || IsBlockWater(BlockID))
return 0;
Vector3f BlockPos;