Delay import of module-prototypes to avoid init-clash. Resolves #2232.
This commit is contained in:
parent
a5506d4e85
commit
012d6a1935
2 changed files with 40 additions and 30 deletions
|
|
@ -392,8 +392,12 @@ def _init():
|
|||
BASE_GUEST_TYPECLASS = class_from_module(settings.BASE_GUEST_TYPECLASS)
|
||||
del class_from_module
|
||||
|
||||
# delayed starts
|
||||
# delayed starts - important so as to not back-access evennia before it has
|
||||
# finished initializing
|
||||
GLOBAL_SCRIPTS.start()
|
||||
from .prototypes import prototypes
|
||||
prototypes.load_module_prototypes()
|
||||
del prototypes
|
||||
|
||||
|
||||
def set_trace(term_size=(140, 80), debugger="auto"):
|
||||
|
|
|
|||
|
|
@ -144,7 +144,13 @@ def homogenize_prototype(prototype, custom_keys=None):
|
|||
|
||||
# module-based prototypes
|
||||
|
||||
for mod in settings.PROTOTYPE_MODULES:
|
||||
def load_module_prototypes():
|
||||
"""
|
||||
This is called by `evennia.__init__` as Evennia initializes. It's important
|
||||
to do this late so as to not interfere with evennia initialization.
|
||||
|
||||
"""
|
||||
for mod in settings.PROTOTYPE_MODULES:
|
||||
# to remove a default prototype, override it with an empty dict.
|
||||
# internally we store as (key, desc, locks, tags, prototype_dict)
|
||||
prots = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue