summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-19 13:31:35 +0200
committerMattes D <github@xoft.cz>2014-07-19 13:31:35 +0200
commitc2aa7d78bfe45e6ca363cb831d5cd605bf1779fc (patch)
treea8de103269fb7ef98a726e51bf8fcdfd17702ab9 /src/Entities/Player.cpp
parentMerge pull request #1224 from mc-server/fixes-potions (diff)
parentWorld.cpp: fixed not all enum fields being used in m_Dimension switch (diff)
downloadcuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.gz
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.bz2
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.lz
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.xz
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.zst
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index ea11926b8..7376441b4 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -382,10 +382,7 @@ short cPlayer::DeltaExperience(short a_Xp_delta)
m_CurrentXp += a_Xp_delta;
// Make sure they didn't subtract too much
- if (m_CurrentXp < 0)
- {
- m_CurrentXp = 0;
- }
+ m_CurrentXp = std::max<short int>(m_CurrentXp, 0);
// Update total for score calculation
if (a_Xp_delta > 0)