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: