diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index a4b938e2d..ea0da309c 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -42,6 +42,7 @@ #include "persistence/taml/tamlCustom.h" #include "sim/netObject.h" +#include "cinterface/cinterface.h" IMPLEMENT_CONOBJECT( SimObject ); @@ -831,6 +832,10 @@ bool SimObject::isMethod( const char* methodName ) if( !methodName || !methodName[0] ) return false; + if (CInterface::isMethod(this->getName(), methodName) || CInterface::isMethod(this->getClassName(), methodName)) { + return true; + } + StringTableEntry stname = StringTable->insert( methodName ); if( getNamespace() ) diff --git a/Engine/source/module/moduleManager.cpp b/Engine/source/module/moduleManager.cpp index b3ef89446..2e71e9e67 100644 --- a/Engine/source/module/moduleManager.cpp +++ b/Engine/source/module/moduleManager.cpp @@ -38,6 +38,8 @@ #include "console/consoleTypes.h" #endif +#include "cinterface/cinterface.h" + #ifndef _MODULE_DEFINITION_H #include "module/moduleDefinition.h" #endif @@ -837,16 +839,7 @@ bool ModuleManager::loadModuleExplicit( const char* pModuleId, const U32 version const bool scriptFileExecuted = dAtob( Con::executef("exec", pLoadReadyModuleDefinition->getModuleScriptFilePath() ) ); // Did we execute the script file? - if ( scriptFileExecuted ) - { - // Yes, so is the create method available? - if ( pScopeSet->isMethod( pLoadReadyModuleDefinition->getCreateFunction() ) ) - { - // Yes, so call the create method. - Con::executef( pScopeSet, pLoadReadyModuleDefinition->getCreateFunction() ); - } - } - else + if ( !scriptFileExecuted ) { // No, so warn. Con::errorf( "Module Manager: Cannot load explicit module Id '%s' at version Id '%d' as it failed to have the script file '%s' loaded.", @@ -854,6 +847,13 @@ bool ModuleManager::loadModuleExplicit( const char* pModuleId, const U32 version } } + // Is the create method available? + if (pScopeSet->isMethod(pLoadReadyModuleDefinition->getCreateFunction())) + { + // Yes, so call the create method. + Con::executef(pScopeSet, pLoadReadyModuleDefinition->getCreateFunction()); + } + // Raise notifications. raiseModulePostLoadNotifications( pLoadReadyModuleDefinition ); }