1
0
Fork 0

Fix XP inditaction when the player dies

This commit is contained in:
kay27 2020-11-10 11:25:35 +04:00
parent c7a4f7cbfb
commit 47c834a809
1 changed files with 2 additions and 2 deletions

View File

@ -278,9 +278,9 @@ minetest.register_on_dieplayer(function(player)
temp_pool = pool[name] temp_pool = pool[name]
xp_amount = temp_pool.xp xp_amount = temp_pool.xp
temp_pool.bar = 0
temp_pool.level = 0
temp_pool.xp = 0 temp_pool.xp = 0
temp_pool.level = 0
temp_pool.bar, temp_pool.bar_step, temp_pool.xp_next_level = mcl_experience.xp_to_bar(temp_pool.xp, temp_pool.level)
hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(temp_pool.level)}) hud_manager.change_hud({player = player, hud_name = "xp_level", element = "text", data = tostring(temp_pool.level)})
hud_manager.change_hud({player = player, hud_name = "experience_bar", element = "number", data = math.floor(temp_pool.bar)}) hud_manager.change_hud({player = player, hud_name = "experience_bar", element = "number", data = math.floor(temp_pool.bar)})