From 319b30eec60ba3931a04bbc65a8c59d93823328b Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Fri, 27 Apr 2018 16:33:45 +0100 Subject: Fix fishing timer (#4217) Fixes ["Fishing Speed Too Slow"](https://forum.cuberite.org/thread-3175-post-29000.html#pid29000). Interestingly, the constants @NiLSPACE points out are actually correct: ```cpp (Random.RandInt(100, 900) - static_cast(a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLure) * 100)) ``` 100 to 900 ticks is the correct timing of 5-45 seconds. However, the timer is only updated when the floater is in the water and the server side position was actually bobbing in and out of the water. This meant the timer took ~2-3x longer than it should. With this change the floater position is always in the water and so the timer works as expected. --- src/Entities/Floater.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Entities/Floater.cpp b/src/Entities/Floater.cpp index 4dc64cf53..82213c668 100644 --- a/src/Entities/Floater.cpp +++ b/src/Entities/Floater.cpp @@ -147,6 +147,11 @@ void cFloater::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) } } } + } + + // Check water at the top of floater otherwise it floats into the air above the water + if (IsBlockWater(m_World->GetBlock(POSX_TOINT, FloorC(GetPosY() + GetHeight()), POSZ_TOINT))) + { SetSpeedY(0.7); } -- cgit v1.2.3