summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2015-06-07 15:41:27 +0200
committerAlexander Harkness <me@bearbin.net>2015-06-07 15:41:27 +0200
commite2c4a0a5956178667739c3e55d80535d97fb9855 (patch)
treeb0677583fc7d71c036c7ae21b9f47eff460a6222 /src
parentMerge pull request #2153 from mc-server/gcc5 (diff)
parentFix incorrent experience sending for 1.7 clients (diff)
downloadcuberite-e2c4a0a5956178667739c3e55d80535d97fb9855.tar
cuberite-e2c4a0a5956178667739c3e55d80535d97fb9855.tar.gz
cuberite-e2c4a0a5956178667739c3e55d80535d97fb9855.tar.bz2
cuberite-e2c4a0a5956178667739c3e55d80535d97fb9855.tar.lz
cuberite-e2c4a0a5956178667739c3e55d80535d97fb9855.tar.xz
cuberite-e2c4a0a5956178667739c3e55d80535d97fb9855.tar.zst
cuberite-e2c4a0a5956178667739c3e55d80535d97fb9855.zip
Diffstat (limited to 'src')
-rw-r--r--src/Protocol/Protocol17x.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index e043698dd..3d96071b5 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1105,8 +1105,8 @@ void cProtocol172::SendExperience (void)
cPacketizer Pkt(*this, 0x1f); // Experience Packet
cPlayer * Player = m_Client->GetPlayer();
Pkt.WriteBEFloat(Player->GetXpPercentage());
- Pkt.WriteBEInt16(static_cast<Int16>(std::max<int>(Player->GetXpLevel(), std::numeric_limits<Int16>::max())));
- Pkt.WriteBEInt16(static_cast<Int16>(std::max<int>(Player->GetCurrentXp(), std::numeric_limits<Int16>::max())));
+ Pkt.WriteBEInt16(static_cast<Int16>(std::min<int>(Player->GetXpLevel(), std::numeric_limits<Int16>::max())));
+ Pkt.WriteBEInt16(static_cast<Int16>(std::min<int>(Player->GetCurrentXp(), std::numeric_limits<Int16>::max())));
}