diff options
author | madmaxoft <github@xoft.cz> | 2013-08-01 09:51:25 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-08-01 09:51:25 +0200 |
commit | f481865c3525b3d981f7016dffba28980bb420b0 (patch) | |
tree | a05f19038785b0bb3af16414cd6169e3d63beac2 | |
parent | ClientHandle: alpha-sorted the HandleXXX functions declarations (diff) | |
download | cuberite-f481865c3525b3d981f7016dffba28980bb420b0.tar cuberite-f481865c3525b3d981f7016dffba28980bb420b0.tar.gz cuberite-f481865c3525b3d981f7016dffba28980bb420b0.tar.bz2 cuberite-f481865c3525b3d981f7016dffba28980bb420b0.tar.lz cuberite-f481865c3525b3d981f7016dffba28980bb420b0.tar.xz cuberite-f481865c3525b3d981f7016dffba28980bb420b0.tar.zst cuberite-f481865c3525b3d981f7016dffba28980bb420b0.zip |
-rw-r--r-- | source/Player.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/Player.cpp b/source/Player.cpp index d59204e35..bbf39f789 100644 --- a/source/Player.cpp +++ b/source/Player.cpp @@ -50,7 +50,7 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) , m_TimeLastPickupCheck( 0.f ) , m_Color('-') , m_ClientHandle( a_Client ) - , m_FoodLevel(20) + , m_FoodLevel(MAX_FOOD_LEVEL) , m_FoodSaturationLevel(5) , m_FoodTickTimer(0) , m_FoodExhaustionLevel(0) @@ -70,7 +70,8 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) m_CurrentWindow = m_InventoryWindow; m_InventoryWindow->OpenedByPlayer(*this); - SetMaxHealth(20); + SetMaxHealth(MAX_HEALTH); + m_Health = MAX_HEALTH; cTimer t1; m_LastPlayerListTime = t1.GetNowTime(); @@ -565,7 +566,7 @@ void cPlayer::Respawn(void) m_Health = GetMaxHealth(); // Reset food level: - m_FoodLevel = 20; + m_FoodLevel = MAX_FOOD_LEVEL; m_FoodSaturationLevel = 5; m_ClientHandle->SendRespawn(); @@ -1155,7 +1156,7 @@ bool cPlayer::LoadFromDisk() cFile f; if (!f.Open(SourceFile, cFile::fmRead)) { - LOGWARNING("Cannot open player data file \"%s\" for reading", SourceFile.c_str()); + // This is a new player whom we haven't seen yet, bail out, let them have the defaults return false; } |