lord-server / lord

Minetest Lord Of The Rings Game
https://lord-server.ru/
16 stars 21 forks source link

Player hp changes (+1 every 3 seconds) even when its full #1739

Open Doloment opened 3 weeks ago

Doloment commented 3 weeks ago

My suspicion is that this is caused by the hunger mod, healing the player if the hunger bar is full image To reproduce:

  1. Add this code somewhere in launched mods
    core.register_on_player_hpchange(function(player, hp_change, reason)
    minetest.chat_send_all("HP change: "..hp_change)
    return hp_change
    end, true)
  2. Enter a world
  3. Make sure you have the full hunger bar
  4. PROFIT
alek13 commented 3 weeks ago

@Doloment dump reason, pls

Doloment commented 3 weeks ago
{
        type = "set_hp",
        from = "mod"
}
alek13 commented 3 weeks ago

@Doloment

stack traceback:
        ...n/../games/lord/mods/lord/Core/damage/src/damage/api.lua:12: in function 'func'
        ...t/lord-server/_minetest/bin/../builtin/game/register.lua:495: in function <...t/lord-server/_minetest/bin/../builtin/game/register.lua:491>
        [C]: in function 'set_hp'
        ...ames/lord/mods/lord/Player/hud_modpack/hbhunger/init.lua:134: in function <...ames/lord/mods/lord/Player/hud_modpack/hbhunger/init.lua:120>
        ...lord-server/_minetest/bin/../builtin/common/register.lua:26: in function <...lord-server/_minetest/bin/../builtin/common/register.lua:12>