From 780c3c763ab02348eca21722b33ff1c0a8c9a02b Mon Sep 17 00:00:00 2001 From: Florin Pop Date: Mon, 24 Jun 2024 05:02:12 +0200 Subject: [PATCH] Clear old handlers before adding new ones --- pettingzoo/sisl/waterworld/waterworld_base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pettingzoo/sisl/waterworld/waterworld_base.py b/pettingzoo/sisl/waterworld/waterworld_base.py index b6705b76b..7c82da4e4 100644 --- a/pettingzoo/sisl/waterworld/waterworld_base.py +++ b/pettingzoo/sisl/waterworld/waterworld_base.py @@ -313,6 +313,8 @@ def draw(self): def add_handlers(self): # Collision handlers for pursuers v.s. evaders & poisons + self.handlers = [] + for pursuer in self.pursuers: for obj in self.evaders: self.handlers.append(