1
0
Fork 0

updated plugin again...

This commit is contained in:
Daniel O'Brien 2013-11-16 22:17:46 +11:00
parent 25ccc33252
commit b3bb34974f
3 changed files with 6 additions and 6 deletions

View File

@ -859,7 +859,7 @@ end
function HandleRemoveXp(a_Split, a_Player)
a_Player:SetExperience(0);
a_Player:SetCurrentExperience(0);
return true;
end

View File

@ -336,15 +336,15 @@ float cPlayer::GetXpPercentage()
bool cPlayer::SetCurrentExperience(short int a_XpTotal)
bool cPlayer::SetCurrentExperience(short int a_CurrentXp)
{
if(!(a_XpTotal >= 0) || (a_XpTotal > (SHRT_MAX - m_LifetimeTotalXp)))
if(!(a_CurrentXp >= 0) || (a_CurrentXp > (SHRT_MAX - m_LifetimeTotalXp)))
{
LOGWARNING("Tried to update experiece with an invalid Xp value: %d", a_XpTotal);
LOGWARNING("Tried to update experiece with an invalid Xp value: %d", a_CurrentXp);
return false; //oops, they gave us a dodgey number
}
m_CurrentXp = a_XpTotal;
m_CurrentXp = a_CurrentXp;
// Set experience to be updated
m_bDirtyExperience = true;

View File

@ -429,7 +429,7 @@ protected:
static short XpForLevel(short int a_Level);
/// inverse of XpAtLevel, ref: http://minecraft.gamepedia.com/XP values are as per this with pre-calculations
static short CalcLevelFromXp(short int a_XpCurrent);
static short CalcLevelFromXp(short int a_CurrentXp);
bool m_IsChargingBow;
int m_BowCharge;