Merge pull request #15 from berengma/range

add protection check, fish die on dry land
This commit is contained in:
Gundul 2019-11-30 16:13:19 +01:00 committed by GitHub
commit 03923b108c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,8 @@ minetest.register_craftitem("water_life:riverfish", {
if number.all > water_life.maxmobs or number.fish > 10 then return itemstack end
local name = placer:get_player_name()
if minetest.is_protected(pos,name) then return itemstack end
local obj = minetest.add_entity(pos, "water_life:fish_tamed")
obj = obj:get_luaentity()
itemstack:take_item()

View File

@ -40,6 +40,7 @@ minetest.register_entity(":zombiestrd:shark", {
-- register shark food
water_life.register_shark_food("water_life:fish") --fish is too small for sharks
water_life.register_shark_food("water_life:fish_tamed")
if minetest.get_modpath("wildlife") then
water_life.register_shark_food("wildlife:deer")
water_life.register_shark_food("wildlife:wolf")

View File

@ -9,6 +9,7 @@ local function fish_brain(self)
return
end
if mobkit.timer(self,1) then
if not self.isinliquid then mobkit.hurt(self,1) end
local plyr = mobkit.get_nearby_player(self)
if plyr and self.wild then
water_life.hq_swimfrom(self,50,plyr,3)