summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-03-20 15:45:42 +0100
committermadmaxoft <github@xoft.cz>2014-03-20 15:45:42 +0100
commit64d9390069650bbbc1850d5602b9854a1c1a7257 (patch)
tree02d504711e730d235cd6b1c2c874e797a6359902 /src/Protocol/Protocol17x.cpp
parentProtoProxy: Fixed MSVC compilation. (diff)
downloadcuberite-64d9390069650bbbc1850d5602b9854a1c1a7257.tar
cuberite-64d9390069650bbbc1850d5602b9854a1c1a7257.tar.gz
cuberite-64d9390069650bbbc1850d5602b9854a1c1a7257.tar.bz2
cuberite-64d9390069650bbbc1850d5602b9854a1c1a7257.tar.lz
cuberite-64d9390069650bbbc1850d5602b9854a1c1a7257.tar.xz
cuberite-64d9390069650bbbc1850d5602b9854a1c1a7257.tar.zst
cuberite-64d9390069650bbbc1850d5602b9854a1c1a7257.zip
Diffstat (limited to 'src/Protocol/Protocol17x.cpp')
-rw-r--r--src/Protocol/Protocol17x.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 6fc344eaf..21c77e903 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -689,7 +689,7 @@ void cProtocol172::SendPlayerAbilities(void)
Pkt.WriteByte(Flags);
// TODO: Pkt.WriteFloat(m_Client->GetPlayer()->GetMaxFlyingSpeed());
Pkt.WriteFloat(0.05f);
- Pkt.WriteFloat((float)m_Client->GetPlayer()->GetMaxSpeed());
+ Pkt.WriteFloat((float)(0.1 * m_Client->GetPlayer()->GetMaxSpeed()));
}
@@ -743,13 +743,14 @@ void cProtocol172::SendPlayerMaxSpeed(void)
Pkt.WriteInt(m_Client->GetPlayer()->GetUniqueID());
Pkt.WriteInt(1); // Count
Pkt.WriteString("generic.movementSpeed");
- Pkt.WriteDouble(0.1);
+ // The default game speed is 0.1, multiply that value by the relative speed:
+ Pkt.WriteDouble(0.1 * m_Client->GetPlayer()->GetNormalMaxSpeed());
if (m_Client->GetPlayer()->IsSprinting())
{
Pkt.WriteShort(1); // Modifier count
Pkt.WriteInt64(0x662a6b8dda3e4c1c);
Pkt.WriteInt64(0x881396ea6097278d); // UUID of the modifier
- Pkt.WriteDouble(0.3);
+ Pkt.WriteDouble(m_Client->GetPlayer()->GetSprintingMaxSpeed() - m_Client->GetPlayer()->GetNormalMaxSpeed());
Pkt.WriteByte(2);
}
else