fix:no milk baby calfs. Fix: calf fed twice when manually fed

master
root 2021-10-25 21:18:44 +02:00
parent 70dc84dbff
commit a5ab149ad0
1 changed files with 3 additions and 3 deletions

View File

@ -59,10 +59,7 @@ end
---
petz.milk_refill = function(self)
self.food_count = self.food_count + 1
mobkit.remember(self, "food_count", self.food_count)
if self.food_count >= 5 then -- if calf replaces 5x grass then it refill milk
self.food_count = mobkit.remember(self, "food_count", self.food_count)
self.milked = mobkit.remember(self, "milked", false)
end
end
@ -71,6 +68,9 @@ petz.milk_milk = function(self, clicker)
if self.is_male then
minetest.chat_send_player(clicker:get_player_name(), S("Milk only female animals!"))
return
elseif self.is_baby then
minetest.chat_send_player(clicker:get_player_name(), S("You cannot milk babies!"))
return
end
local inv = clicker:get_inventory()
local wielded_item = clicker:get_wielded_item()