diff options
author | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-22 17:30:40 +0100 |
---|---|---|
committer | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-22 17:30:40 +0100 |
commit | e54373160b69c342dd1a625a841bda3707ba7acf (patch) | |
tree | 2a01aba188c6d79ab366cb4dbb0a4dc94ff31a55 /source/cTracer.cpp | |
parent | Missed a class in r94 ;) Sorry guys :D (diff) | |
download | cuberite-e54373160b69c342dd1a625a841bda3707ba7acf.tar cuberite-e54373160b69c342dd1a625a841bda3707ba7acf.tar.gz cuberite-e54373160b69c342dd1a625a841bda3707ba7acf.tar.bz2 cuberite-e54373160b69c342dd1a625a841bda3707ba7acf.tar.lz cuberite-e54373160b69c342dd1a625a841bda3707ba7acf.tar.xz cuberite-e54373160b69c342dd1a625a841bda3707ba7acf.tar.zst cuberite-e54373160b69c342dd1a625a841bda3707ba7acf.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cTracer.cpp | 7 |
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;
|