mirror of
https://github.com/evennia/evennia.git
synced 2026-04-05 15:37:17 +02:00
Added a try..except catch for auto-puppeting objects that no longer exist.
This commit is contained in:
parent
a9bc6a1f64
commit
fc341b20a0
1 changed files with 10 additions and 2 deletions
|
|
@ -709,10 +709,18 @@ class DefaultPlayer(with_metaclass(TypeclassBase, PlayerDB)):
|
|||
if _MULTISESSION_MODE == 0:
|
||||
# in this mode we should have only one character available. We
|
||||
# try to auto-connect to our last conneted object, if any
|
||||
self.puppet_object(session, self.db._last_puppet)
|
||||
try:
|
||||
self.puppet_object(session, self.db._last_puppet)
|
||||
except RuntimeError:
|
||||
self.msg("The Character does not exist.")
|
||||
return
|
||||
elif _MULTISESSION_MODE == 1:
|
||||
# in this mode all sessions connect to the same puppet.
|
||||
self.puppet_object(session, self.db._last_puppet)
|
||||
try:
|
||||
self.puppet_object(session, self.db._last_puppet)
|
||||
except RuntimeError:
|
||||
self.msg("The Character does not exist.")
|
||||
return
|
||||
elif _MULTISESSION_MODE in (2, 3):
|
||||
# In this mode we by default end up at a character selection
|
||||
# screen. We execute look on the player.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue