From a03b48fb3f212043b9cea64fe6d08af8922e6cbd Mon Sep 17 00:00:00 2001 From: Ryan Stebe Date: Sat, 13 Mar 2021 14:02:54 -0500 Subject: [PATCH] Fixed remove_character() leaving empty indexes --- Bomberman/bomberman/world.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Bomberman/bomberman/world.py b/Bomberman/bomberman/world.py index 9a4458d2..92d24a62 100644 --- a/Bomberman/bomberman/world.py +++ b/Bomberman/bomberman/world.py @@ -149,6 +149,8 @@ def remove_character(self, character): i = self.index(character.x, character.y) if (i in self.characters) and (character in self.characters[i]): self.characters[i].remove(character) + if not self.characters[i]: + del self.characters[i] def check_blast(self, bomb, x, y): # Check if a wall has been hit