summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel O'Brien <marmot.daniel@gmail.com>2013-11-16 12:17:46 +0100
committerDaniel O'Brien <marmot.daniel@gmail.com>2013-11-16 12:17:46 +0100
commitb3bb34974fddfae6cea9ca59d71f95e32621793d (patch)
tree12a0b8d134007bec96a4b6e19a4f9bd4f08a2c67
parentupdated plugin (diff)
downloadcuberite-b3bb34974fddfae6cea9ca59d71f95e32621793d.tar
cuberite-b3bb34974fddfae6cea9ca59d71f95e32621793d.tar.gz
cuberite-b3bb34974fddfae6cea9ca59d71f95e32621793d.tar.bz2
cuberite-b3bb34974fddfae6cea9ca59d71f95e32621793d.tar.lz
cuberite-b3bb34974fddfae6cea9ca59d71f95e32621793d.tar.xz
cuberite-b3bb34974fddfae6cea9ca59d71f95e32621793d.tar.zst
cuberite-b3bb34974fddfae6cea9ca59d71f95e32621793d.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua2
-rw-r--r--source/Entities/Player.cpp8
-rw-r--r--source/Entities/Player.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 491d294e2..9350606cc 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -859,7 +859,7 @@ end
function HandleRemoveXp(a_Split, a_Player)
- a_Player:SetExperience(0);
+ a_Player:SetCurrentExperience(0);
return true;
end
diff --git a/source/Entities/Player.cpp b/source/Entities/Player.cpp
index bdcf0aae9..38b41fb19 100644
--- a/source/Entities/Player.cpp
+++ b/source/Entities/Player.cpp
@@ -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;
diff --git a/source/Entities/Player.h b/source/Entities/Player.h
index 463a6d8dc..5abca9899 100644
--- a/source/Entities/Player.h
+++ b/source/Entities/Player.h
@@ -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;