mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 14:56:30 +01:00
Fixed a bug in which creating a SimpleDoor caused the next exit created to fail silently.
This commit is contained in:
parent
6db118ac61
commit
112e457cc3
1 changed files with 5 additions and 5 deletions
|
|
@ -101,20 +101,20 @@ class CmdOpen(default_cmds.CmdOpen):
|
|||
"""
|
||||
Simple wrapper for the default CmdOpen.create_exit
|
||||
"""
|
||||
# create a new exit as normal
|
||||
new_exit = super(CmdOpen, self).create_exit(exit_name, location, destination,
|
||||
exit_aliases=exit_aliases, typeclass=typeclass)
|
||||
if hasattr(self, "return_exit_already_created"):
|
||||
# we don't create a return exit if it was already created (because
|
||||
# we created a door)
|
||||
del self.return_exit_already_created
|
||||
return None
|
||||
# create a new exit as normal
|
||||
new_exit = super(CmdOpen, self).create_exit(exit_name, location, destination,
|
||||
exit_aliases=exit_aliases, typeclass=typeclass)
|
||||
return new_exit
|
||||
if inherits_from(new_exit, SimpleDoor):
|
||||
# a door - create its counterpart and make sure to turn off the default
|
||||
# return-exit creation of CmdOpen
|
||||
self.caller.msg("Note: A door-type exit was created - ignored eventual custom return-exit type.")
|
||||
self.return_exit_already_created = True
|
||||
back_exit = super(CmdOpen, self).create_exit(exit_name, destination, location,
|
||||
back_exit = self.create_exit(exit_name, destination, location,
|
||||
exit_aliases=exit_aliases, typeclass=typeclass)
|
||||
new_exit.db.return_exit = back_exit
|
||||
back_exit.db.return_exit = new_exit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue