From 97aff179c1e436ccb369ee2a08f25d9250ef637f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 19 Aug 2013 22:48:13 +0200 Subject: Debuggers: Added continuous hunger reporting. Showcases the OnWorldTick() hook to fire events at regular intervals. Will be used for debugging the issues related to hyper-hunger. --- source/Entities/Player.cpp | 4 ++-- source/Entities/Player.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'source/Entities') diff --git a/source/Entities/Player.cpp b/source/Entities/Player.cpp index 8ad071453..3ccb4ca1d 100644 --- a/source/Entities/Player.cpp +++ b/source/Entities/Player.cpp @@ -340,9 +340,9 @@ void cPlayer::SetFoodTickTimer(int a_FoodTickTimer) -void cPlayer::SetFoodExhaustionLevel(double a_FoodSaturationLevel) +void cPlayer::SetFoodExhaustionLevel(double a_FoodExhaustionLevel) { - m_FoodExhaustionLevel = std::max(0.0, std::min(a_FoodSaturationLevel, 4.0)); + m_FoodExhaustionLevel = std::max(0.0, std::min(a_FoodExhaustionLevel, 4.0)); } diff --git a/source/Entities/Player.h b/source/Entities/Player.h index 62595f980..5dcce8421 100644 --- a/source/Entities/Player.h +++ b/source/Entities/Player.h @@ -171,14 +171,17 @@ public: void SetFoodLevel (int a_FoodLevel); void SetFoodSaturationLevel (double a_FoodSaturationLevel); void SetFoodTickTimer (int a_FoodTickTimer); - void SetFoodExhaustionLevel (double a_FoodSaturationLevel); + void SetFoodExhaustionLevel (double a_FoodExhaustionLevel); void SetFoodPoisonedTicksRemaining(int a_FoodPoisonedTicksRemaining); /// Adds to FoodLevel and FoodSaturationLevel, returns true if any food has been consumed, false if player "full" bool Feed(int a_Food, double a_Saturation); /// Adds the specified exhaustion to m_FoodExhaustion. Expects only positive values. - void AddFoodExhaustion(double a_Exhaustion) { m_FoodExhaustionLevel += a_Exhaustion; } + void AddFoodExhaustion(double a_Exhaustion) + { + m_FoodExhaustionLevel += a_Exhaustion; + } /// Starts the food poisoning for the specified amount of ticks; if already foodpoisoned, sets FoodPoisonedTicksRemaining to the larger of the two void FoodPoison(int a_NumTicks); -- cgit v1.2.3