diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2018-07-12 15:34:52 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2018-07-12 15:34:52 +0200 |
commit | 8eebc3ec74f7cc611a53ef1afa8773450ad9b237 (patch) | |
tree | ea7733cbc97014f831a741327f56a5e1789c0eab /init.lua | |
parent | 07f276f4f4ff81dab88a2a1f1bfba57e6538509b (diff) |
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -186,11 +186,14 @@ minetest.register_abm({ end local objs = minetest.get_objects_inside_radius(pos, radius) for _,obj in ipairs(objs) do - if not obj:is_player() and obj:get_armor_groups().fleshy and obj:get_armor_groups().fleshy > 0 and is_mob(obj) then - -- obj:on_rightclick(fake_player) - if obj:get_luaentity().on_rightclick then - obj:get_luaentity():on_rightclick(fake_player) - end + ent = obj:get_luaentity() + if not obj:is_player() and obj:get_armor_groups().fleshy and obj:get_armor_groups().fleshy > 0 and is_mob(obj) then + if ent.on_rightclick then + if ent.horny and node.name == "feedlot:feedlot" then + return + end + obj:get_luaentity():on_rightclick(fake_player) + end -- minetest.chat_send_all("animal fed") end end |