1
0

finished #143 I believe

This commit is contained in:
Daniel O'Brien
2013-11-16 02:23:50 +11:00
parent 5e3614ce87
commit 04dff4882a
14 changed files with 45 additions and 16 deletions

View File

@@ -339,7 +339,7 @@ bool cPlayer::SetExperience(short int a_XpTotal)
m_XpTotal = a_XpTotal;
//send details to client
m_ClientHandle->SendSetExperience();
SendExperience();
return true;
}
@@ -363,7 +363,7 @@ short cPlayer::AddExperience(short a_Xp_delta)
m_XpTotal += a_Xp_delta;
//send details to client
m_ClientHandle->SendSetExperience();
SendExperience();
return m_XpTotal;
}
@@ -615,6 +615,18 @@ void cPlayer::SendHealth(void)
void cPlayer::SendExperience(void)
{
if (m_ClientHandle != NULL)
{
m_ClientHandle->SendExperience();
}
}
void cPlayer::ClearInventoryPaintSlots(void)
{
// Clear the list of slots that are being inventory-painted. Used by cWindow only
@@ -1419,12 +1431,13 @@ bool cPlayer::LoadFromDisk()
SetRoll ((float)JSON_PlayerRotation[(unsigned int)2].asDouble());
}
m_Health = root.get("health", 0).asInt();
m_Health = root.get("health", 0).asInt();
m_AirLevel = root.get("air", MAX_AIR_LEVEL).asInt();
m_FoodLevel = root.get("food", MAX_FOOD_LEVEL).asInt();
m_FoodSaturationLevel = root.get("foodSaturation", MAX_FOOD_LEVEL).asDouble();
m_FoodTickTimer = root.get("foodTickTimer", 0).asInt();
m_FoodExhaustionLevel = root.get("foodExhaustion", 0).asDouble();
m_XpTotal = root.get("experience", 0).asInt();
//SetExperience(root.get("experience", 0).asInt());