Mercurial > rinkhals
comparison gamelib/gameboard.py @ 400:d146b7bb9b99
Fix lurking future bug
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Tue, 17 Nov 2009 22:22:47 +0000 |
parents | 3294929223bd |
children | 7405f7db469f |
comparison
equal
deleted
inserted
replaced
399:3294929223bd | 400:d146b7bb9b99 |
---|---|
809 w, h = self.tv.size | 809 w, h = self.tv.size |
810 self._fox_pos_cache = [[[False for z in range(5)] for y in range(h)] | 810 self._fox_pos_cache = [[[False for z in range(5)] for y in range(h)] |
811 for x in range(w)] # NB: Assumes z in [0, 4] | 811 for x in range(w)] # NB: Assumes z in [0, 4] |
812 for fox in self.foxes: | 812 for fox in self.foxes: |
813 if self.in_bounds(fox.pos): | 813 if self.in_bounds(fox.pos): |
814 self._fox_pos_cache[pos.x][pos.y][pos.z] = True | 814 self._fox_pos_cache[fox.pos.x][fox.pos.y][fox.pos.z] = True |
815 | 815 |
816 def _update_fox_pos_cache(self, old_pos, new_pos): | 816 def _update_fox_pos_cache(self, old_pos, new_pos): |
817 if self.is_fox_at_pos(old_pos): | 817 if self.is_fox_at_pos(old_pos): |
818 self._fox_pos_cache[old_pos.x][old_pos.y][old_pos.z] = False | 818 self._fox_pos_cache[old_pos.x][old_pos.y][old_pos.z] = False |
819 if new_pos and self.in_bounds(new_pos): | 819 if new_pos and self.in_bounds(new_pos): |