From 8570d08eb4f9f3e1b30fe7758e8b136213e6bf48 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 20 Dec 2013 17:11:51 +0100 Subject: More reordering fixes. --- src/Entities/Floater.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/Entities/Floater.cpp') diff --git a/src/Entities/Floater.cpp b/src/Entities/Floater.cpp index 1aa0413d9..bd7c952a8 100644 --- a/src/Entities/Floater.cpp +++ b/src/Entities/Floater.cpp @@ -1,14 +1,19 @@ + #include "Globals.h" #include "Floater.h" #include "Player.h" #include "../ClientHandle.h" + + + + cFloater::cFloater(double a_X, double a_Y, double a_Z, Vector3d a_Speed, int a_PlayerID) : cEntity(etFloater, a_X, a_Y, a_Z, 0.98, 0.98), + m_PickupCountDown(0), m_PlayerID(a_PlayerID), - m_CanPickupItem(false), - m_PickupCountDown(0) + m_CanPickupItem(false) { SetSpeed(a_Speed); } @@ -55,4 +60,8 @@ void cFloater::Tick(float a_Dt, cChunk & a_Chunk) } } BroadcastMovementUpdate(); -} \ No newline at end of file +} + + + + -- cgit v1.2.3 From af98fc61703d719fe4dbff08a3d342c8053c3603 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Fri, 20 Dec 2013 18:34:08 +0100 Subject: Fixed bug where the floater could pop in the water while you could already get a fish. --- src/Entities/Floater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Entities/Floater.cpp') diff --git a/src/Entities/Floater.cpp b/src/Entities/Floater.cpp index bd7c952a8..0eefa9c54 100644 --- a/src/Entities/Floater.cpp +++ b/src/Entities/Floater.cpp @@ -36,7 +36,7 @@ void cFloater::Tick(float a_Dt, cChunk & a_Chunk) HandlePhysics(a_Dt, a_Chunk); if (IsBlockWater(m_World->GetBlock((int) GetPosX(), (int) GetPosY(), (int) GetPosZ()))) { - if (m_World->GetTickRandomNumber(100) == 0) + if ((!m_CanPickupItem) && (m_World->GetTickRandomNumber(100) == 0)) { SetPosY(GetPosY() - 1); m_CanPickupItem = true; @@ -45,7 +45,7 @@ void cFloater::Tick(float a_Dt, cChunk & a_Chunk) } else { - SetSpeedY(1); + SetSpeedY(0.7); } } SetSpeedX(GetSpeedX() * 0.95); -- cgit v1.2.3 From 8efde94e4e25dadbe8083c755bfbc780f1540b48 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 21 Dec 2013 14:07:32 +0100 Subject: Fixed bug where you could get fish from non-source blocks. --- src/Entities/Floater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Entities/Floater.cpp') diff --git a/src/Entities/Floater.cpp b/src/Entities/Floater.cpp index 0eefa9c54..52089b776 100644 --- a/src/Entities/Floater.cpp +++ b/src/Entities/Floater.cpp @@ -34,7 +34,7 @@ void cFloater::SpawnOn(cClientHandle & a_Client) void cFloater::Tick(float a_Dt, cChunk & a_Chunk) { HandlePhysics(a_Dt, a_Chunk); - if (IsBlockWater(m_World->GetBlock((int) GetPosX(), (int) GetPosY(), (int) GetPosZ()))) + if (IsBlockWater(m_World->GetBlock((int) GetPosX(), (int) GetPosY(), (int) GetPosZ())) && m_World->GetBlockMeta((int) GetPosX(), (int) GetPosY(), (int) GetPosZ()) != 0) { if ((!m_CanPickupItem) && (m_World->GetTickRandomNumber(100) == 0)) { -- cgit v1.2.3 From 128de10a2f7246b059f9ce41539c91dbcd30844a Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 21 Dec 2013 14:11:21 +0100 Subject: You could now only get fish from non-source blocks. Fixed it. --- src/Entities/Floater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Entities/Floater.cpp') diff --git a/src/Entities/Floater.cpp b/src/Entities/Floater.cpp index 52089b776..ac7a82f91 100644 --- a/src/Entities/Floater.cpp +++ b/src/Entities/Floater.cpp @@ -34,7 +34,7 @@ void cFloater::SpawnOn(cClientHandle & a_Client) void cFloater::Tick(float a_Dt, cChunk & a_Chunk) { HandlePhysics(a_Dt, a_Chunk); - if (IsBlockWater(m_World->GetBlock((int) GetPosX(), (int) GetPosY(), (int) GetPosZ())) && m_World->GetBlockMeta((int) GetPosX(), (int) GetPosY(), (int) GetPosZ()) != 0) + if (IsBlockWater(m_World->GetBlock((int) GetPosX(), (int) GetPosY(), (int) GetPosZ())) && m_World->GetBlockMeta((int) GetPosX(), (int) GetPosY(), (int) GetPosZ()) == 0) { if ((!m_CanPickupItem) && (m_World->GetTickRandomNumber(100) == 0)) { -- cgit v1.2.3