From c3bf84b07025cb1085df869920ed7f61bb4101d5 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 27 Oct 2015 19:22:24 +0000 Subject: [PATCH] Can only breed animals when horny and close together (3 nodes) --- api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 096be2a..684fc49 100644 --- a/api.lua +++ b/api.lua @@ -423,12 +423,12 @@ local function breed(self) end end - -- find another same animal who is also horny and mate + -- find another same animal who is also horny and mate if close enough if self.horny == true and self.hornytimer <= 40 then local pos = self.object:getpos() effect({x = pos.x, y = pos.y + 1, z = pos.z}, 4, "heart.png") - local ents = minetest.get_objects_inside_radius(pos, self.view_range) + local ents = minetest.get_objects_inside_radius(pos, 3) local num = 0 local ent = nil for i,obj in ipairs(ents) do