Mercurial > rinkhals
comparison gamelib/gameboard.py @ 536:1a224ba50edf
Correctly set the position of newly hatched chickens in buildings
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Fri, 27 Nov 2009 23:29:32 +0000 |
parents | c1f14fa35d30 |
children | ec5276cfe98b |
comparison
equal
deleted
inserted
replaced
535:7e8dbd513ea2 | 536:1a224ba50edf |
---|---|
950 def place_hatched_chicken(self, new_chick, building): | 950 def place_hatched_chicken(self, new_chick, building): |
951 try: | 951 try: |
952 building.add_occupant(new_chick) | 952 building.add_occupant(new_chick) |
953 self.add_chicken(new_chick) | 953 self.add_chicken(new_chick) |
954 new_chick.equip(equipment.Nest()) | 954 new_chick.equip(equipment.Nest()) |
955 new_chick.set_pos(new_chick.abode.get_pos()) | |
955 except buildings.BuildingFullError: | 956 except buildings.BuildingFullError: |
956 # No space in the hen house, look nearby | 957 # No space in the hen house, look nearby |
957 for tile_pos in building.adjacent_tiles(): | 958 for tile_pos in building.adjacent_tiles(): |
958 if self.tv.get(tile_pos) != self.GRASSLAND: | 959 if self.tv.get(tile_pos) != self.GRASSLAND: |
959 continue | 960 continue |