diff --git a/main.py b/main.py index cfe9f6b..84443cb 100644 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ recompute_fov = True def can_pass(x, y): global recompute_fov - recompute_fov = map.map[y][x].passable() + recompute_fov = map.can_walk(x, y) return recompute_fov def main_loop(): diff --git a/map.py b/map.py index 3178bdd..1ac7647 100644 --- a/map.py +++ b/map.py @@ -62,3 +62,6 @@ def find_random_square(self, occupied): return x, y #if nothing found - let's try once again return self.find_random_square(occupied) + + def can_walk(self, x, y): + return self.map[y][x].passable() and not self.has_critter_at( (x, y))