1
0

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<int>(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.
This commit is contained in:
peterbell10 2018-04-27 16:33:45 +01:00 committed by GitHub
parent 02d75c5336
commit 319b30eec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}