From f9b3b3b60a85b07f662bb01b628cf26b71b9bd4c Mon Sep 17 00:00:00 2001 From: ChrisLR Date: Tue, 18 Jan 2022 16:11:00 -0500 Subject: [PATCH] Added method call to load module prototypes when searching if not already loaded --- evennia/prototypes/prototypes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/evennia/prototypes/prototypes.py b/evennia/prototypes/prototypes.py index 2e83d698a2..1f666d931a 100644 --- a/evennia/prototypes/prototypes.py +++ b/evennia/prototypes/prototypes.py @@ -31,7 +31,6 @@ from evennia.utils.funcparser import FuncParser from evennia.utils import dbserialize from evennia.utils.evtable import EvTable - _MODULE_PROTOTYPE_MODULES = {} _MODULE_PROTOTYPES = {} _PROTOTYPE_META_NAMES = ( @@ -516,6 +515,10 @@ def search_prototype(key=None, tags=None, require_single=False, return_iterators be found as a match. """ + # This will load the prototypes the first time they are searched + if not _MODULE_PROTOTYPE_MODULES: + load_module_prototypes() + # prototype keys are always in lowecase if key: key = key.lower()