From f241b4315ce022078a14f1cc45f823eb3c2fc624 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:55:09 +0800 Subject: [PATCH] Fix: wait_selected() has no return --- tasks/item/inventory.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tasks/item/inventory.py b/tasks/item/inventory.py index 9975952f5..347b893bf 100644 --- a/tasks/item/inventory.py +++ b/tasks/item/inventory.py @@ -319,6 +319,13 @@ class InventoryManager: self.update() def wait_selected(self, skip_first_screenshot=True): + """ + Args: + skip_first_screenshot: + + Returns: + bool: If success + """ timeout = Timer(2, count=6).start() while 1: if skip_first_screenshot: @@ -328,7 +335,7 @@ class InventoryManager: self.update() if self.selected is not None: - break + return True if timeout.reached(): logger.warning('Wait inventory selected timeout') - break + return False