From af4ef21675e0a373df1ba6d7b772b74ba207d4ea Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 20 May 2017 23:34:31 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20annoying=20mcl=5Fhunger=20typo=20(?= =?UTF-8?q?=E2=80=9Cpoisen=E2=80=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mods/PLAYER/mcl_hunger/hunger.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mods/PLAYER/mcl_hunger/hunger.lua b/mods/PLAYER/mcl_hunger/hunger.lua index ad4d122db2..fc9588871b 100644 --- a/mods/PLAYER/mcl_hunger/hunger.lua +++ b/mods/PLAYER/mcl_hunger/hunger.lua @@ -25,11 +25,11 @@ end -- food functions local food = mcl_hunger.food -function mcl_hunger.register_food(name, hunger_change, replace_with_item, poisen, heal, sound) +function mcl_hunger.register_food(name, hunger_change, replace_with_item, poison, heal, sound) food[name] = {} food[name].saturation = hunger_change -- hunger points added food[name].replace = replace_with_item -- what item is given back after eating - food[name].poisen = poisen -- time its poisening + food[name].poison = poison -- time its poisoning food[name].healing = heal -- amount of HP food[name].sound = sound -- special sound that is played when eating end @@ -46,19 +46,19 @@ function mcl_hunger.eat(hp_change, replace_with_item, itemstack, user, pointed_t def.saturation = hp_change def.replace = replace_with_item end - local func = mcl_hunger.item_eat(def.saturation, def.replace, def.poisen, def.healing, def.sound) + local func = mcl_hunger.item_eat(def.saturation, def.replace, def.poison, def.healing, def.sound) return func(itemstack, user, pointed_thing) end -- Poison player -local function poisenp(tick, time, time_left, player) +local function poisonp(tick, time, time_left, player) -- First check if player is still there if not player:is_player() then return end time_left = time_left + tick if time_left < time then - minetest.after(tick, poisenp, tick, time, time_left, player) + minetest.after(tick, poisonp, tick, time, time_left, player) else mcl_hunger.poisonings[player:get_player_name()] = mcl_hunger.poisonings[player:get_player_name()] - 1 if mcl_hunger.poisonings[player:get_player_name()] <= 0 then @@ -72,7 +72,7 @@ local function poisenp(tick, time, time_left, player) end -function mcl_hunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound) +function mcl_hunger.item_eat(hunger_change, replace_with_item, poison, heal, sound) return function(itemstack, user, pointed_thing) local itemname = itemstack:get_name() if itemstack:take_item() ~= nil and user ~= nil then @@ -151,11 +151,11 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisen, heal, sou mcl_hunger.update_saturation_hud(user, mcl_hunger.get_saturation(user), h) end -- Poison - if poisen then + if poison then -- Set poison bar hb.change_hudbar(user, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png") mcl_hunger.poisonings[name] = mcl_hunger.poisonings[name] + 1 - poisenp(1, poisen, 0, user) + poisonp(1, poison, 0, user) end --sound:eat