1
0

New players get full health

Fixes #28.
This commit is contained in:
madmaxoft 2013-08-01 09:51:25 +02:00
parent 86831056dc
commit f481865c35

View File

@ -50,7 +50,7 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
, m_TimeLastPickupCheck( 0.f ) , m_TimeLastPickupCheck( 0.f )
, m_Color('-') , m_Color('-')
, m_ClientHandle( a_Client ) , m_ClientHandle( a_Client )
, m_FoodLevel(20) , m_FoodLevel(MAX_FOOD_LEVEL)
, m_FoodSaturationLevel(5) , m_FoodSaturationLevel(5)
, m_FoodTickTimer(0) , m_FoodTickTimer(0)
, m_FoodExhaustionLevel(0) , m_FoodExhaustionLevel(0)
@ -70,7 +70,8 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
m_CurrentWindow = m_InventoryWindow; m_CurrentWindow = m_InventoryWindow;
m_InventoryWindow->OpenedByPlayer(*this); m_InventoryWindow->OpenedByPlayer(*this);
SetMaxHealth(20); SetMaxHealth(MAX_HEALTH);
m_Health = MAX_HEALTH;
cTimer t1; cTimer t1;
m_LastPlayerListTime = t1.GetNowTime(); m_LastPlayerListTime = t1.GetNowTime();
@ -565,7 +566,7 @@ void cPlayer::Respawn(void)
m_Health = GetMaxHealth(); m_Health = GetMaxHealth();
// Reset food level: // Reset food level:
m_FoodLevel = 20; m_FoodLevel = MAX_FOOD_LEVEL;
m_FoodSaturationLevel = 5; m_FoodSaturationLevel = 5;
m_ClientHandle->SendRespawn(); m_ClientHandle->SendRespawn();
@ -1155,7 +1156,7 @@ bool cPlayer::LoadFromDisk()
cFile f; cFile f;
if (!f.Open(SourceFile, cFile::fmRead)) 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; return false;
} }