From 2b3308fd1f08b44aaf2c0143833bdf542fbc71cc Mon Sep 17 00:00:00 2001 From: Owllex Date: Mon, 13 Dec 2021 11:48:51 -0800 Subject: [PATCH] Minor adjustment to cleanup(). --- evennia/contrib/cooldowns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/contrib/cooldowns.py b/evennia/contrib/cooldowns.py index 4a565d6c8e..3f9ba66bb6 100644 --- a/evennia/contrib/cooldowns.py +++ b/evennia/contrib/cooldowns.py @@ -200,8 +200,8 @@ class CooldownHandler: now = time.time() cooldowns = dict(self.data) keys = [x for x in cooldowns.keys() if cooldowns[x] - now < 0] - for key in keys: - del cooldowns[key] if keys: + for key in keys: + del cooldowns[key] self.obj.attributes.add(self.db_attribute, cooldowns) self.data = self.obj.attributes.get(self.db_attribute)