From c78859bae3f4c4bd823a8e069ac08c336cb322c4 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 15 Apr 2025 11:57:24 -0700 Subject: [PATCH] Fix logic bug in the beast's sleep schedule --- typeclasses/pets.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/typeclasses/pets.py b/typeclasses/pets.py index 0ca4558..72af955 100755 --- a/typeclasses/pets.py +++ b/typeclasses/pets.py @@ -423,7 +423,7 @@ class BHB(Friendly): (minute, hour, tod, season) = self.location.get_time() - if hour >= wake_hour and hour < sleep_hour and minute > 6: + if hour >= wake_hour and hour < sleep_hour: self.db.is_awake = True else: self.db.is_awake = False @@ -445,10 +445,12 @@ class BHB(Friendly): elif minute == 3: msg = f"The {noun} lets loose a big yawn." - if self.db.is_awake and self.location == self.global_search('The Cave'): - self.execute_cmd("leave") - elif not self.db.is_awake and self.location == self.global_search('Meadow'): - self.execute_cmd("cave") + meadow = self.global_search("mp05") + cave = self.global_search("mp07") + if self.db.is_awake and self.location != meadow: + self.move_to(meadow, move_type="traverse") + elif not self.db.is_awake and self.location != cave: + self.move_to(cave, move_type="traverse") if msg and self.location: self.location.msg_contents(msg)