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.
This commit is contained in:
Howard Abrams 2025-08-28 23:59:28 -07:00
parent 586fdadf7a
commit 1df17bd858
2 changed files with 6 additions and 2 deletions

View file

@ -197,8 +197,10 @@ class OpenableRoom(Room):
Move the 'open_exit' to this location. Move the 'open_exit' to this location.
""" """
the_exit = self.db.open_exit the_exit = self.db.open_exit
if the_exit and the_exit.key.endswith(item): the_item = self.db.open_item
if the_exit.location == self: 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.") opener.msg(f"The {item} is already open.")
return True return True
the_exit.location = self the_exit.location = self

View file

@ -23,6 +23,7 @@ from evennia import (
utils, utils,
) )
from evennia.commands.default.general import CmdInventory from evennia.commands.default.general import CmdInventory
from evennia.commands.default.cmdset_account import CmdOOC
# from evennia.utils import dedent, delay, search # from evennia.utils import dedent, delay, search
from evennia.contrib.rpg.rpsystem import CmdEmote from evennia.contrib.rpg.rpsystem import CmdEmote
@ -166,6 +167,7 @@ class DarkCmdSet(CmdSet):
self.add(CmdGM()) self.add(CmdGM())
self.add(CmdLight()) self.add(CmdLight())
self.add(CmdInventory()) self.add(CmdInventory())
self.add(CmdOOC())
self.add(default_cmds.CmdQuit()) self.add(default_cmds.CmdQuit())
self.add(default_cmds.CmdHome()) self.add(default_cmds.CmdHome())