Fix the 'close' command in an Openable Room

This commit is contained in:
Howard Abrams 2025-08-29 00:10:21 -07:00
parent 1df17bd858
commit 4d578df314

View file

@ -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: