Mercurial > rinkhals
diff gamelib/animal.py @ 457:fc648da2334c
Fix position cache removal, slightly optimise chicken range check.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Mon, 23 Nov 2009 16:12:37 +0000 |
parents | af2482444945 |
children | d4f04d81fe54 |
line wrap: on
line diff
--- a/gamelib/animal.py Mon Nov 23 10:30:22 2009 +0000 +++ b/gamelib/animal.py Mon Nov 23 16:12:37 2009 +0000 @@ -255,9 +255,9 @@ """Choose a random fox within range of this weapon.""" killable_foxes = [] for fox in gameboard.foxes: - if not visible(self, fox, gameboard): + if not weapon.in_range(gameboard, self, fox): continue - if weapon.in_range(gameboard, self, fox): + if visible(self, fox, gameboard): killable_foxes.append(fox) if not killable_foxes: return None