Skip to content

Commit

Permalink
Fix error with latest Minetest-dev version by fixing the logical order (
Browse files Browse the repository at this point in the history
#34)

`stamina.set_saturation()` uses the hud id set for the player. Thus, the id should be set before calling this function.
Until now, it only worked because of undocumented behaviour. See minetest/minetest#10568
  • Loading branch information
Thomas--S committed Oct 31, 2020
1 parent e4e456a commit b4519d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ minetest.register_on_joinplayer(function(player)
offset = {x = -266, y = -110},
max = 0,
})
stamina.set_saturation(player, level)
set_hud_id(player, id)
stamina.set_saturation(player, level)
-- reset poisoned
stamina.set_poisoned(player, false)
-- remove legacy hud_id from player metadata
Expand Down

1 comment on commit b4519d1

@mckaygerhard
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to work in minetest 0.4.X just rollback this version and that's all

Please sign in to comment.