From 1df17bd85842135ffe5958324e3ae34cbb18dedf Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Thu, 28 Aug 2025 23:59:28 -0700 Subject: [PATCH] Fix an openable room by specifying the openable item This allows the exit to be something other than the item used to open the exit. --- typeclasses/rooms.py | 6 ++++-- typeclasses/rooms_dark.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/typeclasses/rooms.py b/typeclasses/rooms.py index 351236e..16c660f 100644 --- a/typeclasses/rooms.py +++ b/typeclasses/rooms.py @@ -197,8 +197,10 @@ class OpenableRoom(Room): Move the 'open_exit' to this location. """ the_exit = self.db.open_exit - if the_exit and the_exit.key.endswith(item): - if the_exit.location == self: + the_item = self.db.open_item + if the_exit and ((the_item and item.lower() ==the_item.lower()) or + the_exit.key.lower().endswith(item)): + if the_exit.location ==self: opener.msg(f"The {item} is already open.") return True the_exit.location = self diff --git a/typeclasses/rooms_dark.py b/typeclasses/rooms_dark.py index c0b9b03..2a1d37c 100755 --- a/typeclasses/rooms_dark.py +++ b/typeclasses/rooms_dark.py @@ -23,6 +23,7 @@ from evennia import ( utils, ) from evennia.commands.default.general import CmdInventory +from evennia.commands.default.cmdset_account import CmdOOC # from evennia.utils import dedent, delay, search from evennia.contrib.rpg.rpsystem import CmdEmote @@ -166,6 +167,7 @@ class DarkCmdSet(CmdSet): self.add(CmdGM()) self.add(CmdLight()) self.add(CmdInventory()) + self.add(CmdOOC()) self.add(default_cmds.CmdQuit()) self.add(default_cmds.CmdHome())