Fix custom module support loading code
This commit is contained in:
parent
3471738bc1
commit
439556ff4b
1 changed files with 3 additions and 1 deletions
|
@ -175,6 +175,8 @@ func register_custom_module(module_name: String, module_class: CoreBaseModule) -
|
|||
logger.errorf("Core", "Registering module failed: A custom module with the name \"" + module_name + "\" already exists.")
|
||||
return false
|
||||
module_class.name = module_name
|
||||
logger.diagf("Core", "Updating variables")
|
||||
module_class.core = self
|
||||
logger.diagf("Core", "Adding module to SceneTree")
|
||||
custom_modules_node.add_child(module_class)
|
||||
logger.diagf("Core", "Merging module with custom_modules")
|
||||
|
@ -201,7 +203,7 @@ func get_custom_module(module_name: String) -> CoreBaseModule:
|
|||
logger.diagf("Core", "Getting custom module \"" + module_name + "\"")
|
||||
if !custom_modules.has(module_name):
|
||||
logger.errorf("Core", "Getting module failed: A custom module with the name \"" + module_name + "\" does not exist.")
|
||||
return
|
||||
return null
|
||||
return custom_modules[module_name]
|
||||
|
||||
# (Re-)Load configuration
|
||||
|
|
Loading…
Reference in a new issue