Skip to content

Commit 3942f59

Browse files
committed
Fixed server ignoring module initialization failure
1 parent b73c138 commit 3942f59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

MTA10_Server/mods/deathmatch/logic/lua/CLuaModule.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ int CLuaModule::_LoadModule ( void )
116116
//if ( m_FunctionInfo.ResourceStopped == NULL ) return 7;
117117
#endif
118118
// Run initialisation function
119-
pfnInitFunc( this, &m_FunctionInfo.szModuleName[0], &m_FunctionInfo.szAuthor[0], &m_FunctionInfo.fVersion );
119+
if ( !pfnInitFunc( this, &m_FunctionInfo.szModuleName[0], &m_FunctionInfo.szAuthor[0], &m_FunctionInfo.fVersion ) )
120+
{
121+
CLogger::LogPrintf ( "MODULE: Unable to initialize modules/%s!\n", m_szShortFileName.c_str() );
122+
return 2;
123+
}
120124
m_bInitialised = true;
121125

122126
CLogger::LogPrintf ("MODULE: Loaded \"%s\" (%.2f) by \"%s\"\n", m_FunctionInfo.szModuleName, m_FunctionInfo.fVersion, m_FunctionInfo.szAuthor);

0 commit comments

Comments
 (0)