Dirty bugfix
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Thu, 23 Nov 2017 16:25:48 +0000 (17:25 +0100)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Thu, 23 Nov 2017 16:25:48 +0000 (17:25 +0100)
init.lua

index 877170c..30af488 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -174,7 +174,9 @@ minetest.register_abm({
         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)
-              obj:get_luaentity():on_rightclick(fake_player)
+              if obj.get_luaentity().on_rightclick then
+                 obj:get_luaentity():on_rightclick(fake_player)
+              end
 --            minetest.chat_send_all("animal fed")
            end
         end