summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-03-22 15:48:16 +0100
committerTycho <work.tycho+git@gmail.com>2014-03-22 15:48:16 +0100
commit2266c2150daad68c19d320683f6bf5abd7f2ebb2 (patch)
tree111fe0c36643afd27317b8d9a4c7912b6899ec4a /src/Protocol/Protocol17x.cpp
parentPatched tolua to understand size_t (diff)
parentImplemented faster upscaling using templates. (diff)
downloadcuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.gz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.bz2
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.lz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.xz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.zst
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.zip
Diffstat (limited to 'src/Protocol/Protocol17x.cpp')
-rw-r--r--src/Protocol/Protocol17x.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 6fc344eaf..721ed349e 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -687,9 +687,8 @@ void cProtocol172::SendPlayerAbilities(void)
Flags |= 0x04;
}
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.05 * m_Client->GetPlayer()->GetFlyingMaxSpeed()));
+ Pkt.WriteFloat((float)(0.1 * m_Client->GetPlayer()->GetMaxSpeed()));
}
@@ -743,13 +742,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