From 176a65e0ec93a27b2495cec07239a06c0685fa33 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 7 Aug 2020 18:06:39 +0100 Subject: [PATCH] Prevent waddle seat IDs going out of sync Fixes bug where CJ Fire games would become unresponsive after a player has left or lost the game --- houdini/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/houdini/__init__.py b/houdini/__init__.py index e36d73c..a68666e 100644 --- a/houdini/__init__.py +++ b/houdini/__init__.py @@ -75,12 +75,13 @@ class IWaddle(ABC): await penguin.join_room(penguin.server.rooms[room_id]) async def remove_penguin(self, p): - self.penguins.remove(p) + self.penguins[self.penguins.index(p)] = None p.waddle = None async def send_xt(self, *data, f=None): for penguin in filter(f, self.penguins): - await penguin.send_xt(*data) + if penguin is not None: + await penguin.send_xt(*data) def get_seat_id(self, p): return self.penguins.index(p)