From f3fb80200da44e8ee37cf4d9d4ebce1aae8b9ebe Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 6 Mar 2021 23:07:16 +0400 Subject: [PATCH] Revert "Fix XP bar overflow if trying to go over XP limit", please see https://git.minetest.land/MineClone2/MineClone2/issues/1261 This reverts commit f6f2037e6a1e1921ff1dc5c8da2da7fc63f92805. --- mods/HUD/mcl_experience/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/HUD/mcl_experience/init.lua b/mods/HUD/mcl_experience/init.lua index de93f1dc2e..7b89bd3b76 100644 --- a/mods/HUD/mcl_experience/init.lua +++ b/mods/HUD/mcl_experience/init.lua @@ -312,7 +312,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 = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level) + temp_pool.bar = temp_pool.bar + temp_pool.bar_step * experience 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)