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:
parent
586fdadf7a
commit
1df17bd858
2 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue