comparison gamelib/animal.py @ 515:88bda6db953a

Fix buggy test
author Neil Muller <drnlmuller@gmail.com>
date Fri, 27 Nov 2009 11:34:59 +0000
parents 57f9077fb7fb
children a42852e50df1
comparison
equal deleted inserted replaced
514:55b95bb25ced 515:88bda6db953a
443 cost = self._cost_tile(tpos) 443 cost = self._cost_tile(tpos)
444 if cost >= COST_MARGIN: 444 if cost >= COST_MARGIN:
445 return False 445 return False
446 return True 446 return True
447 447
448 # We check left, then right and take the shortest if both are valid
449 return self._search_for_path(border, corner, 6) 448 return self._search_for_path(border, corner, 6)
450 449
451 def _find_fence_gap(self): 450 def _find_fence_gap(self):
452 # We search for a gap in the fence 451 # We search for a gap in the fence
453 # we know we are next to fence. A gap in the fence is 452 # we know we are next to fence. A gap in the fence is
700 change_visible = True 699 change_visible = True
701 elif self.building and final_pos.z == 0: 700 elif self.building and final_pos.z == 0:
702 # can only leave from the ground floor 701 # can only leave from the ground floor
703 if building == self.building: 702 if building == self.building:
704 # Check if we need to leave the building 703 # Check if we need to leave the building
705 if not self.hunting or (self.closest and 704 if not self.hunting or (self.closest and self.closest.abode
706 self.closest.abode.building is not building): 705 and self.closest.abode.building is not building):
707 self.building.remove_predator(self) 706 self.building.remove_predator(self)
708 change_visible = True 707 change_visible = True
709 else: 708 else:
710 # we've moved away from the building we were in 709 # we've moved away from the building we were in
711 self.building.remove_predator(self) 710 self.building.remove_predator(self)