From a35a71422d721ff2f02ae8963e85db77238efc01 Mon Sep 17 00:00:00 2001 From: mar77i Date: Fri, 30 Aug 2024 11:34:59 +0200 Subject: [PATCH] if the door is open and we're there, don't queue --- elevator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/elevator.py b/elevator.py index a6c8f83..e7ad1ee 100755 --- a/elevator.py +++ b/elevator.py @@ -308,8 +308,9 @@ class Elevator: return None def open_if_there(self, level): - if self.get_whole_level() == level and self.doors[level].state != Door.OPEN: - self.doors[level].open() + if self.get_whole_level() == level: + if self.doors[level].state != Door.OPEN: + self.doors[level].open() return True return False -- 2.47.0