summaryrefslogtreecommitdiffstats
path: root/src/Entities/Boat.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-02-09 09:36:42 +0100
committermadmaxoft <github@xoft.cz>2014-02-09 09:36:42 +0100
commita184d592097c24c8796e8680e2ef7fdfe081305d (patch)
tree20df62dcde07191f927d9df8916375a25c8ccc87 /src/Entities/Boat.cpp
parentMoved a forgotten comment back to its place. (diff)
parentMerge branch 'master' into playerimprovements (diff)
downloadcuberite-a184d592097c24c8796e8680e2ef7fdfe081305d.tar
cuberite-a184d592097c24c8796e8680e2ef7fdfe081305d.tar.gz
cuberite-a184d592097c24c8796e8680e2ef7fdfe081305d.tar.bz2
cuberite-a184d592097c24c8796e8680e2ef7fdfe081305d.tar.lz
cuberite-a184d592097c24c8796e8680e2ef7fdfe081305d.tar.xz
cuberite-a184d592097c24c8796e8680e2ef7fdfe081305d.tar.zst
cuberite-a184d592097c24c8796e8680e2ef7fdfe081305d.zip
Diffstat (limited to 'src/Entities/Boat.cpp')
-rw-r--r--src/Entities/Boat.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp
index 184aeeeeb..67df201ce 100644
--- a/src/Entities/Boat.cpp
+++ b/src/Entities/Boat.cpp
@@ -89,8 +89,14 @@ void cBoat::Tick(float a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
BroadcastMovementUpdate();
- SetSpeed(GetSpeed() * 0.97); // Slowly decrease the speed.
- if (IsBlockWater(m_World->GetBlock((int) GetPosX(), (int) GetPosY(), (int) GetPosZ())))
+ SetSpeed(GetSpeed() * 0.97); // Slowly decrease the speed
+
+ if ((POSY_TOINT < 0) || (POSY_TOINT > cChunkDef::Height))
+ {
+ return;
+ }
+
+ if (IsBlockWater(m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT)))
{
SetSpeedY(1);
}