diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-09 00:02:50 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-09 00:02:50 +0100 |
commit | 14b5054c95bc294a62792b4d82331c970809f07f (patch) | |
tree | 14c8b1a3c0a69c7dadd9067ba1a7db0d70491c4d /src | |
parent | Moved Gamemode setting into General root tag (diff) | |
download | cuberite-14b5054c95bc294a62792b4d82331c970809f07f.tar cuberite-14b5054c95bc294a62792b4d82331c970809f07f.tar.gz cuberite-14b5054c95bc294a62792b4d82331c970809f07f.tar.bz2 cuberite-14b5054c95bc294a62792b4d82331c970809f07f.tar.lz cuberite-14b5054c95bc294a62792b4d82331c970809f07f.tar.xz cuberite-14b5054c95bc294a62792b4d82331c970809f07f.tar.zst cuberite-14b5054c95bc294a62792b4d82331c970809f07f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Boat.cpp | 10 |
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); } |