From 14b5054c95bc294a62792b4d82331c970809f07f Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 8 Feb 2014 23:02:50 +0000 Subject: Fixed a boat ASSERT --- src/Entities/Boat.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Entities/Boat.cpp') 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); } -- cgit v1.2.3 From 145b3492e7b27abb5a5a8aca1b37cb98ba03a772 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Mon, 24 Feb 2014 12:58:57 +0100 Subject: Small improvements to boats. --- src/Entities/Boat.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Entities/Boat.cpp') diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp index 67df201ce..94b24c5af 100644 --- a/src/Entities/Boat.cpp +++ b/src/Entities/Boat.cpp @@ -89,6 +89,7 @@ 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 ((POSY_TOINT < 0) || (POSY_TOINT > cChunkDef::Height)) @@ -98,7 +99,10 @@ void cBoat::Tick(float a_Dt, cChunk & a_Chunk) if (IsBlockWater(m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT))) { - SetSpeedY(1); + if (GetSpeedY() < 2) + { + AddSpeedY(0.2); + } } } @@ -108,12 +112,12 @@ void cBoat::Tick(float a_Dt, cChunk & a_Chunk) void cBoat::HandleSpeedFromAttachee(float a_Forward, float a_Sideways) { - if (GetSpeed().Length() > 7) + if (GetSpeed().Length() > 7.5) { return; } - Vector3d ToAddSpeed(m_Attachee->GetLookVector() * (a_Sideways * 1.5)); + Vector3d ToAddSpeed = m_Attachee->GetLookVector() * (a_Sideways * 0.4) ; ToAddSpeed.y = 0; AddSpeed(ToAddSpeed); -- cgit v1.2.3 From eb3cc729d4e367c54a47369f712831908f8da22c Mon Sep 17 00:00:00 2001 From: Samuel Barney Date: Tue, 25 Mar 2014 11:15:05 -0600 Subject: More fixes to get it to compile for me on Mac 10.9. Mostly just newline additions, but some of the unused variables were causing errors, so I wrapped them in #ifndef __APPLE__ calls, since I didn't know if they were going to be used in the future. Also had to undefine TOLUA_TEMPLATE_BIND a couple of times. --- src/Entities/Boat.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/Entities/Boat.cpp') diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp index 94b24c5af..921252253 100644 --- a/src/Entities/Boat.cpp +++ b/src/Entities/Boat.cpp @@ -122,5 +122,3 @@ void cBoat::HandleSpeedFromAttachee(float a_Forward, float a_Sideways) AddSpeed(ToAddSpeed); } - - \ No newline at end of file -- cgit v1.2.3