fix: Fix off-by-one bug in level calculation

master
Luther Wen Xu 2020-05-31 11:04:07 +07:00
parent 830eeb543a
commit 0b2e1caf51
Signed by: chanbakjsd
GPG Key ID: B7D77E3E9D102B70
1 changed files with 1 additions and 1 deletions

@ -61,7 +61,7 @@ func GetLevelFromXP(xp int64) (Rank, int) {
// 3 => 1 (2^1=2)
// 4 => 1 (2^1=2)
// 5 => 2 (2^2=4)
for level > (1 << rank) {
for level >= (1 << rank) {
if rank == int(RankDemigod) {
break
}