mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-05-31 19:36:27 -04:00
fix for issue #2
This commit is contained in:
parent
ef2d61c035
commit
d7db2cd111
1 changed files with 73 additions and 69 deletions
|
@ -417,6 +417,7 @@ function better_fauna.hq_fowl_breed(self, prty)
|
||||||
if mobkit.is_queue_empty_low(self) then
|
if mobkit.is_queue_empty_low(self) then
|
||||||
local pos = mobkit.get_stand_pos(self)
|
local pos = mobkit.get_stand_pos(self)
|
||||||
local tpos = mate:get_pos()
|
local tpos = mate:get_pos()
|
||||||
|
if tpos ~= nil and tpos.x ~= nil and tpos.y ~= nil and tpos.z ~= nil then
|
||||||
local dist = vec_dist(pos, tpos) - math.abs(hitbox(self)[4])
|
local dist = vec_dist(pos, tpos) - math.abs(hitbox(self)[4])
|
||||||
if dist > 1.5 then
|
if dist > 1.5 then
|
||||||
speed_factor = 0.5
|
speed_factor = 0.5
|
||||||
|
@ -454,6 +455,7 @@ function better_fauna.hq_fowl_breed(self, prty)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
mobkit.queue_high(self, func, prty)
|
mobkit.queue_high(self, func, prty)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -461,6 +463,7 @@ function better_fauna.hq_eat(self, prty)
|
||||||
local func = function(self)
|
local func = function(self)
|
||||||
local pos = mobkit.get_stand_pos(self)
|
local pos = mobkit.get_stand_pos(self)
|
||||||
local under = vector.new(pos.x, pos.y - 1, pos.z)
|
local under = vector.new(pos.x, pos.y - 1, pos.z)
|
||||||
|
if self.consumable_nodes ~= nil then
|
||||||
for _, node in ipairs(self.consumable_nodes) do
|
for _, node in ipairs(self.consumable_nodes) do
|
||||||
if node.name == minetest.get_node(under).name then
|
if node.name == minetest.get_node(under).name then
|
||||||
minetest.set_node(under, {name = node.replacement})
|
minetest.set_node(under, {name = node.replacement})
|
||||||
|
@ -500,6 +503,7 @@ function better_fauna.hq_eat(self, prty)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
mobkit.queue_high(self, func, prty)
|
mobkit.queue_high(self, func, prty)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue