1
0

fixed XpGetPercentage

This commit is contained in:
Daniel O'Brien 2013-11-15 01:46:41 +11:00
parent 79a98627a2
commit ea778c7027
2 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@ -318,8 +318,10 @@ int cPlayer::XpGetLevel()
float cPlayer::XpGetPercentage()
{
int currentLevel = CalcLevelFromXp(m_XpTotal);
int currentLevel_XpBase = XpForLevel(currentLevel);
return (float)m_XpTotal / (float)XpForLevel(1+currentLevel);
return (float)(m_XpTotal - currentLevel_XpBase) /
(float)(XpForLevel(1+currentLevel) - currentLevel_XpBase);
}