Fix for NoneType exceptions when initial_setup.py is run where multisession_mode is not set to 0.

This commit is contained in:
Kate 2015-08-21 22:21:57 -06:00 committed by Griatch
parent 5b6376fd87
commit 8647bf2367
2 changed files with 11 additions and 5 deletions

View file

@ -83,10 +83,12 @@ class CmdOOCLook(MuxPlayerCommand):
sessid = self.sessid
# get all our characters and sessions
characters = player.db._playable_characters
if None in characters:
# clean up list if character object was deleted in between
characters = [character for character in characters if character]
player.db._playable_characters = characters
if characters is not None:
if None in characters:
# clean up list if character object was deleted in between
characters = [character for character in characters if character]
player.db._playable_characters = characters
sessions = player.get_all_sessions()
is_su = player.is_superuser

View file

@ -105,7 +105,11 @@ def create_objects():
god_player.attributes.add("_first_login", True)
god_player.attributes.add("_last_puppet", god_character)
god_player.db._playable_characters.append(god_character)
try:
god_player.db._playable_characters.append(god_character)
except AttributeError:
pass
room_typeclass = settings.BASE_ROOM_TYPECLASS
limbo_obj = create.create_object(room_typeclass, _('Limbo'), nohome=True)