From f3b6c516e6d3b83056fa7dc67cd95de8b7909ac5 Mon Sep 17 00:00:00 2001 From: Giovani Date: Fri, 16 Jul 2021 15:07:08 -0400 Subject: [PATCH] fix: address issue with unsync color and squares --- tetri5/entity.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tetri5/entity.py b/tetri5/entity.py index 0a2a5e8..069f190 100644 --- a/tetri5/entity.py +++ b/tetri5/entity.py @@ -354,6 +354,10 @@ class Stack(Entity): self.total_lines += self.lines_completed_last def draw(self, surface: pygame.Surface) -> None: + # only draw if squares and colors are aligned + if len(self._square_colors) != len(self._points): + return + for i in range(len(self._points)): square = self._points[i] square_design = self._square_colors[i]