Fixes object delete method so that deleted characters are removed from owner's playable character list.
This commit is contained in:
parent
1f3d8d1b96
commit
5c3bdd1b4a
2 changed files with 22 additions and 0 deletions
|
|
@ -913,8 +913,12 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
|||
# no need to disconnect, Account just jumps to OOC mode.
|
||||
# sever the connection (important!)
|
||||
if self.account:
|
||||
# Remove the object from playable characters list
|
||||
if self in self.account.db._playable_characters:
|
||||
self.account.db._playable_characters = [x for x in self.account.db._playable_characters if x != self]
|
||||
for session in self.sessions.all():
|
||||
self.account.unpuppet_object(session)
|
||||
|
||||
self.account = None
|
||||
|
||||
for script in _ScriptDB.objects.get_all_scripts_on_obj(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue