summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-12-14 23:40:24 +0100
committerMattes D <github@xoft.cz>2013-12-14 23:40:24 +0100
commit5e6a4c99a7509e480e4c2b31d66044ec1fa44559 (patch)
tree9815ee7865a445f45a31485225649f5e977ef339 /src/Entities/Player.cpp
parentAdded tolua++ redirection include. (diff)
parentExported E_EFFECTS_<Effect> to lua. Forgot to commit Globals.h. (diff)
downloadcuberite-5e6a4c99a7509e480e4c2b31d66044ec1fa44559.tar
cuberite-5e6a4c99a7509e480e4c2b31d66044ec1fa44559.tar.gz
cuberite-5e6a4c99a7509e480e4c2b31d66044ec1fa44559.tar.bz2
cuberite-5e6a4c99a7509e480e4c2b31d66044ec1fa44559.tar.lz
cuberite-5e6a4c99a7509e480e4c2b31d66044ec1fa44559.tar.xz
cuberite-5e6a4c99a7509e480e4c2b31d66044ec1fa44559.tar.zst
cuberite-5e6a4c99a7509e480e4c2b31d66044ec1fa44559.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 85833f31d..b2485a8e2 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -557,9 +557,13 @@ void cPlayer::FoodPoison(int a_NumTicks)
m_FoodPoisonedTicksRemaining = std::max(m_FoodPoisonedTicksRemaining, a_NumTicks);
if (!HasBeenFoodPoisoned)
{
- // TODO: Send the poisoning indication to the client - how?
+ m_ClientHandle->SendRemoveEntityEffect(*this, E_EFFECT_HUNGER);
SendHealth();
}
+ else
+ {
+ m_ClientHandle->SendEntityEffect(*this, E_EFFECT_HUNGER, 0, 20);
+ }
}
@@ -1704,6 +1708,10 @@ void cPlayer::HandleFood(void)
m_FoodPoisonedTicksRemaining--;
m_FoodExhaustionLevel += 0.025; // 0.5 per second = 0.025 per tick
}
+ else
+ {
+ m_ClientHandle->SendRemoveEntityEffect(*this, E_EFFECT_HUNGER); // remove the "Hunger" effect.
+ }
// Apply food exhaustion that has accumulated:
if (m_FoodExhaustionLevel >= 4)