Fix compatibility with older hbhunger else crash when eating food

This commit is contained in:
sys4 2017-11-11 19:40:33 +01:00
parent 1fd07978c5
commit 9857652809

View File

@ -100,7 +100,11 @@ function diet.item_eat(max, replace_with_item, poisen, heal)
h = h + points h = h + points
if h > 30 then h = 30 end if h > 30 then h = 30 end
hbhunger.hunger[name] = h hbhunger.hunger[name] = h
hbhunger.set_hunger_raw(user)
local set_hunger = hbhunger.set_hunger_raw
if not set_hunger then set_hunger = hbhunger.set_hunger end
set_hunger(user)
-- healing -- healing
local hp = user:get_hp() local hp = user:get_hp()