Fixed another stuuuuubid crash.

This commit is contained in:
The Wobbler 2024-07-16 13:11:22 +02:00
parent 19210b0032
commit 5c773fa3db

View file

@ -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):