Add files via upload

master
AiTechEye 2019-05-06 21:42:01 +02:00 committed by GitHub
parent b9933099a2
commit 2315956b34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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