diff options
author | archshift <admin@archshift.com> | 2014-06-07 06:55:23 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-06-17 20:39:19 +0200 |
commit | 2123173202554487386697625342b7ba21744960 (patch) | |
tree | 7c6c9938e87df3883c78a02caf2e4867b53c9b1f /src/Entities/Player.cpp | |
parent | Entity effects: Added handlers for entity effects (diff) | |
download | cuberite-2123173202554487386697625342b7ba21744960.tar cuberite-2123173202554487386697625342b7ba21744960.tar.gz cuberite-2123173202554487386697625342b7ba21744960.tar.bz2 cuberite-2123173202554487386697625342b7ba21744960.tar.lz cuberite-2123173202554487386697625342b7ba21744960.tar.xz cuberite-2123173202554487386697625342b7ba21744960.tar.zst cuberite-2123173202554487386697625342b7ba21744960.zip |
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r-- | src/Entities/Player.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 95ee8b39d..3a1ebf3f9 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -40,7 +40,6 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) , m_FoodSaturationLevel(5) , m_FoodTickTimer(0) , m_FoodExhaustionLevel(0) - , m_FoodPoisonedTicksRemaining(0) , m_LastJumpHeight(0) , m_LastGroundHeight(0) , m_bTouchGround(false) @@ -551,15 +550,6 @@ void cPlayer::SetFoodExhaustionLevel(double a_FoodExhaustionLevel) -void cPlayer::SetFoodPoisonedTicksRemaining(int a_FoodPoisonedTicksRemaining) -{ - m_FoodPoisonedTicksRemaining = a_FoodPoisonedTicksRemaining; -} - - - - - bool cPlayer::Feed(int a_Food, double a_Saturation) { if (m_FoodLevel >= MAX_FOOD_LEVEL) @@ -580,16 +570,7 @@ bool cPlayer::Feed(int a_Food, double a_Saturation) void cPlayer::FoodPoison(int a_NumTicks) { - bool HasBeenFoodPoisoned = (m_FoodPoisonedTicksRemaining > 0); - m_FoodPoisonedTicksRemaining = std::max(m_FoodPoisonedTicksRemaining, a_NumTicks); - if (!HasBeenFoodPoisoned) - { - SendHealth(); - } - else - { - AddEntityEffect(cEntityEffect::efHunger, cEntityEffect(0, 400)); // Give the player the "Hunger" effect for 20 seconds. - } + AddEntityEffect(cEntityEffect::efHunger, cEntityEffect(0, a_NumTicks)); } |