summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-02-11 15:34:18 +0100
committerHowaner <franzi.moos@googlemail.com>2014-02-16 01:18:10 +0100
commitd15d6acc5837b0f2aa6814b2d9c9a2e440a952e6 (patch)
treebdcf9050ad5bd38854be47d23331ab425aa12d96 /src/Entities/Player.cpp
parentRemoved the unnecessary LoopPlayersAndBroadcastChat() functions. (diff)
downloadcuberite-d15d6acc5837b0f2aa6814b2d9c9a2e440a952e6.tar
cuberite-d15d6acc5837b0f2aa6814b2d9c9a2e440a952e6.tar.gz
cuberite-d15d6acc5837b0f2aa6814b2d9c9a2e440a952e6.tar.bz2
cuberite-d15d6acc5837b0f2aa6814b2d9c9a2e440a952e6.tar.lz
cuberite-d15d6acc5837b0f2aa6814b2d9c9a2e440a952e6.tar.xz
cuberite-d15d6acc5837b0f2aa6814b2d9c9a2e440a952e6.tar.zst
cuberite-d15d6acc5837b0f2aa6814b2d9c9a2e440a952e6.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index d568e068d..6e3db5194 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1764,6 +1764,12 @@ void cPlayer::HandleFood(void)
{
// Ref.: http://www.minecraftwiki.net/wiki/Hunger
+ if (IsGameModeCreative())
+ {
+ // Hunger is disabled for Creative
+ return;
+ }
+
// Remember the food level before processing, for later comparison
int LastFoodLevel = m_FoodLevel;
@@ -1781,7 +1787,7 @@ void cPlayer::HandleFood(void)
Heal(1);
m_FoodExhaustionLevel += 3;
}
- else if (m_FoodLevel <= 0)
+ else if (m_FoodLevel <= 0 && m_Health > 1)
{
// Damage from starving
TakeDamage(dtStarving, NULL, 1, 1, 0);