changeset 515:88bda6db953a

Fix buggy test
author Neil Muller <drnlmuller@gmail.com>
date Fri, 27 Nov 2009 11:34:59 +0000
parents 55b95bb25ced
children 4166a0051bb6
files gamelib/animal.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/animal.py	Fri Nov 27 10:06:28 2009 +0000
+++ b/gamelib/animal.py	Fri Nov 27 11:34:59 2009 +0000
@@ -445,7 +445,6 @@
                         return False
             return True
 
-        # We check left, then right and take the shortest if both are valid
         return self._search_for_path(border, corner, 6)
 
     def _find_fence_gap(self):
@@ -702,8 +701,8 @@
             # can only leave from the ground floor
             if building == self.building:
                 # Check if we need to leave the building
-                if not self.hunting or (self.closest and
-                        self.closest.abode.building is not building):
+                if not self.hunting or (self.closest and self.closest.abode
+                        and self.closest.abode.building is not building):
                     self.building.remove_predator(self)
                     change_visible = True
             else: