Mercurial > rinkhals
changeset 405:ae3cee7a1337
Fix crash due to invalid cache
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Thu, 19 Nov 2009 13:53:00 +0000 |
parents | e5247ec76f24 |
children | f8072b2d6dd1 |
files | gamelib/gameboard.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/gameboard.py Thu Nov 19 13:33:57 2009 +0000 +++ b/gamelib/gameboard.py Thu Nov 19 13:53:00 2009 +0000 @@ -821,7 +821,7 @@ self._pos_cache[cache_type][animal.pos.x][animal.pos.y][animal.pos.z] = animal def _update_pos_cache(self, old_pos, animal, cache_type): - if self.in_bounds(old_pos): + if self.in_bounds(old_pos) and self._pos_cache[cache_type]: self._pos_cache[cache_type][old_pos.x][old_pos.y][old_pos.z] = None if animal: pos = animal.pos