Mercurial > rinkhals
diff gamelib/gameboard.py @ 144:a9b800b4175e
Add define for henhouses & egg laying.
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Thu, 03 Sep 2009 14:59:13 +0000 |
parents | 1d73de63bd71 |
children | 225be1220053 |
line wrap: on
line diff
--- a/gamelib/gameboard.py Thu Sep 03 10:56:38 2009 +0000 +++ b/gamelib/gameboard.py Thu Sep 03 14:59:13 2009 +0000 @@ -447,7 +447,7 @@ def lay_eggs(self): self.eggs = 0 for building in self.buildings: - if building.NAME in [buildings.HenHouse.NAME]: + if building.NAME in buildings.HENHOUSES: for chicken in building.occupants(): chicken.lay() if chicken.egg: @@ -456,7 +456,7 @@ def hatch_eggs(self): for building in self.buildings: - if building.NAME in [buildings.HenHouse.NAME]: + if building.NAME in buildings.HENHOUSES: for chicken in building.occupants(): new_chick = chicken.hatch() if new_chick: @@ -488,9 +488,8 @@ if chick.abode: chick.abode.clear_occupant() self.toolbar.update_chicken_counter(len(self.chickens)) - if chick in self.tv.sprites: - if chick.outside(): - self.tv.sprites.remove(chick) + if chick in self.tv.sprites and chick.outside(): + self.tv.sprites.remove(chick) def remove_building(self, building): if building in self.buildings: