summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-29 13:12:10 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-29 13:12:10 +0200
commitbacc873a175cb37a1878fccf8fa40acb75fb8189 (patch)
tree9196c159286108ffb858d9816da48429473fbde3
parentChanged block send queue to use vectors (diff)
downloadcuberite-bacc873a175cb37a1878fccf8fa40acb75fb8189.tar
cuberite-bacc873a175cb37a1878fccf8fa40acb75fb8189.tar.gz
cuberite-bacc873a175cb37a1878fccf8fa40acb75fb8189.tar.bz2
cuberite-bacc873a175cb37a1878fccf8fa40acb75fb8189.tar.lz
cuberite-bacc873a175cb37a1878fccf8fa40acb75fb8189.tar.xz
cuberite-bacc873a175cb37a1878fccf8fa40acb75fb8189.tar.zst
cuberite-bacc873a175cb37a1878fccf8fa40acb75fb8189.zip
-rw-r--r--src/Entities/Player.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 1e1e868e7..0eacb67f9 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -551,7 +551,7 @@ bool cPlayer::Feed(int a_Food, double a_Saturation)
}
m_FoodLevel = std::min(a_Food + m_FoodLevel, (int)MAX_FOOD_LEVEL);
- m_FoodSaturationLevel = m_FoodSaturationLevel + a_Saturation;
+ m_FoodSaturationLevel = std::min(m_FoodSaturationLevel + a_Saturation, (double)m_FoodLevel);
SendHealth();
return true;