any mob can be fed, fix rightclick function override bug

This commit is contained in:
Tai @ Flex 2016-08-20 13:52:45 +01:00
parent 2c877dfc96
commit 9ca1160ee8

View File

@ -5,8 +5,6 @@
-- TODO adda vivarium:fodder to feed animals in general -- TODO adda vivarium:fodder to feed animals in general
dofile(minetest.get_modpath("vivarium") .. "/bestiary.lua")
function chancer(hp,difficulty) function chancer(hp,difficulty)
return math.floor(1000/hp * hp/(hp*0.4) * difficulty) return math.floor(1000/hp * hp/(hp*0.4) * difficulty)
end end
@ -47,13 +45,15 @@ function captivate(mobname,modset)
lassochance.."...") lassochance.."...")
mobs:capture_mob(self, clicker, handchance, netchance, lassochance, override, replacement) mobs:capture_mob(self, clicker, handchance, netchance, lassochance, override, replacement)
rc_func(self,clicker) if rc_func then
rc_func(self,clicker)
end
end end
mobe.on_rightclick = capturefunction mobe.on_rightclick = capturefunction
if modset.mobtype then if modset.mobtype then
mobe.type = modset.mobtype mobe.type = modset.mobtype
if modset.follow and modset.mobtype ~= "monster" then if modset.follow then
mobe.follow = modset.follow mobe.follow = modset.follow
end end
end end
@ -69,8 +69,10 @@ end
minetest.debug("--- Start Mob Captivator ---") minetest.debug("--- Start Mob Captivator ---")
if bestiary then dofile(minetest.get_modpath("vivarium") .. "/bestiary.lua")
for _,modset in pairs(bestiary) do
if vivarium.bestiary then
for _,modset in pairs(vivarium.bestiary) do
if minetest.get_modpath(modset.name) then if minetest.get_modpath(modset.name) then
if modset.beasts then if modset.beasts then