summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-19 22:48:13 +0200
committermadmaxoft <github@xoft.cz>2013-08-19 22:48:13 +0200
commit97aff179c1e436ccb369ee2a08f25d9250ef637f (patch)
treeba4f91544aa2b0f31382dbcdbda40c903f1d3bf5 /source
parentDeadlockDetect now uses sleep instead of timed-wait semaphores. (diff)
downloadcuberite-97aff179c1e436ccb369ee2a08f25d9250ef637f.tar
cuberite-97aff179c1e436ccb369ee2a08f25d9250ef637f.tar.gz
cuberite-97aff179c1e436ccb369ee2a08f25d9250ef637f.tar.bz2
cuberite-97aff179c1e436ccb369ee2a08f25d9250ef637f.tar.lz
cuberite-97aff179c1e436ccb369ee2a08f25d9250ef637f.tar.xz
cuberite-97aff179c1e436ccb369ee2a08f25d9250ef637f.tar.zst
cuberite-97aff179c1e436ccb369ee2a08f25d9250ef637f.zip
Diffstat (limited to '')
-rw-r--r--source/DeadlockDetect.cpp2
-rw-r--r--source/Entities/Player.cpp4
-rw-r--r--source/Entities/Player.h7
3 files changed, 8 insertions, 5 deletions
diff --git a/source/DeadlockDetect.cpp b/source/DeadlockDetect.cpp
index de9a32d39..5af3f973d 100644
--- a/source/DeadlockDetect.cpp
+++ b/source/DeadlockDetect.cpp
@@ -62,7 +62,7 @@ bool cDeadlockDetect::Start(void)
void cDeadlockDetect::Execute(void)
{
- // Loop until the event is signalled
+ // Loop until the signal to terminate:
while (!m_ShouldTerminate)
{
// Check the world ages:
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);