From 2315956b3475a9d29aaac71e33d5627beeb728bd Mon Sep 17 00:00:00 2001 From: AiTechEye <40591179+AiTechEye@users.noreply.github.com> Date: Mon, 6 May 2019 21:42:01 +0200 Subject: [PATCH] Add files via upload --- aliveai/base.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aliveai/base.lua b/aliveai/base.lua index 0d0063f..6d54836 100644 --- a/aliveai/base.lua +++ b/aliveai/base.lua @@ -29,6 +29,9 @@ aliveai.newpos=function(pos,a) end minetest.register_on_item_eat=function(hp_change, replace_with_item, itemstack, user, pointed_thing) + if not itemstack then + return + end local a=itemstack:get_name() if not aliveai.food[a] and hp_change>0 and minetest.get_item_group(a,"aliveai_eatable")==0 then aliveai.food[a]=hp_change