mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 13:53:45 +01:00
Fix XP bar overflow if trying to go over XP limit
This commit is contained in:
parent
e6d99b8b18
commit
f6f2037e6a
@ -240,7 +240,7 @@ function mcl_experience.add_experience(player, experience)
|
||||
temp_pool.xp = math.min(math.max(temp_pool.xp + experience, 0), max_xp)
|
||||
|
||||
if (temp_pool.xp < temp_pool.xp_next_level) and (temp_pool.xp >= old_xp) then
|
||||
temp_pool.bar = temp_pool.bar + temp_pool.bar_step * experience
|
||||
temp_pool.bar = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level)
|
||||
else
|
||||
temp_pool.level = mcl_experience.xp_to_level(temp_pool.xp)
|
||||
temp_pool.bar, temp_pool.bar_step, temp_pool.xp_next_level = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level)
|
||||
|
Loading…
Reference in New Issue
Block a user