From 5dae7b6964e2f95cc52e1628c44792ca026065ab Mon Sep 17 00:00:00 2001 From: crabman77 Date: Mon, 29 Jun 2015 16:11:39 +0200 Subject: [PATCH] fix crash hunger (nodebreaker) remove old fix --- mods/hbhunger/hunger.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/hbhunger/hunger.lua b/mods/hbhunger/hunger.lua index cca261c7..5016f08d 100755 --- a/mods/hbhunger/hunger.lua +++ b/mods/hbhunger/hunger.lua @@ -392,6 +392,7 @@ function hbhunger.handle_node_actions(pos, oldnode, player, ext) end local name = player:get_player_name() local exhaus = hbhunger.exhaustion[name] + if exhaus == nil then return end -- fix for nodebreaker, if owner has not logged in since the launch of the server, hunger stat is nil,then crash local new = HUNGER_EXHAUST_PLACE -- placenode event if not ext then @@ -401,7 +402,7 @@ function hbhunger.handle_node_actions(pos, oldnode, player, ext) if not pos and not oldnode then new = HUNGER_EXHAUST_MOVE end - exhaus = (exhaus or 0) + new + exhaus = exhaus + new if exhaus > HUNGER_EXHAUST_LVL then exhaus = 0 local h = tonumber(hbhunger.hunger[name])