Prevent possible/rare crash

master
BlockMen 2015-11-09 17:52:42 +01:00
parent 1daf5ee7a9
commit a94f80647f
1 changed files with 5 additions and 5 deletions

View File

@ -182,7 +182,7 @@ local def = {
if self.mode == "eat" and self.eat_node then
self.regrow_wool = true
end
if self.last_mode == "eat" and self.modetimer == 0 and self.regrow_wool then
if self.last_mode == "eat" and (self.modetimer and self.modetimer == 0) and self.regrow_wool then
self.has_wool = true
self.regrow_wool = nil
self.object:set_properties({textures = {"creatures_sheep.png^creatures_sheep_white.png"}})