From 4d578df314241f30159376623a22694e8d9fac40 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Fri, 29 Aug 2025 00:10:21 -0700 Subject: [PATCH] Fix the 'close' command in an Openable Room --- typeclasses/rooms.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/typeclasses/rooms.py b/typeclasses/rooms.py index 16c660f..53bbc49 100644 --- a/typeclasses/rooms.py +++ b/typeclasses/rooms.py @@ -215,7 +215,17 @@ class OpenableRoom(Room): Move the 'open_exit' exit to Limbo. """ the_exit = self.db.open_exit - if the_exit and (not item or the_exit.key.endswith(item)): + + # If a user is trying to close an item (an automatic close, + # item will be None), so we just put in this check here: + the_item = self.db.open_item + if item and ((the_item and item.lower() ==the_item.lower()) or + the_exit.key.lower().endswith(item)): + pass + else: + return None + + if the_exit: if the_exit.location == self: # It is opened and can be closed: the_exit.location = None if closer: