From 5c773fa3db6bc314be8ab54bd8883d977bfc238d Mon Sep 17 00:00:00 2001 From: Wobbl Date: Tue, 16 Jul 2024 13:11:22 +0200 Subject: [PATCH] Fixed another stuuuuubid crash. --- falling_sand.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/falling_sand.py b/falling_sand.py index 8e047cb..014b3c2 100755 --- a/falling_sand.py +++ b/falling_sand.py @@ -213,7 +213,7 @@ class FallingSand: bx += ax by += ay - if not bx > self.sand_surface.get_width() - 2 and self.matrix[bx, by] == self.sand_surface.map_rgb(self.gray) and bx % 2 == 0 and by % 2 == 0: + if bx < self.sand_surface.get_width() - 2 and by < self.sand_surface.get_height() -2 and self.matrix[bx, by] == self.sand_surface.map_rgb(self.gray) and bx % 2 == 0 and by % 2 == 0: self.falling_sand_particles.append(FallingSandParticle(self, (bx, by), color)) def rainbow(self):