Added request amb231 (OnPluginStart errors cause load failures)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40844
This commit is contained in:
David Anderson 2007-05-23 01:59:58 +00:00
parent 936337e54d
commit caab299d3e
2 changed files with 7 additions and 3 deletions

View File

@ -295,7 +295,11 @@ void CPlugin::Call_OnPluginStart()
return;
}
pFunction->Execute(&result);
int err;
if ((err=pFunction->Execute(&result)) != SP_ERROR_NONE)
{
SetErrorState(Plugin_Error, "Error detected in plugin startup (see error logs)");
}
}
void CPlugin::Call_OnPluginEnd()
@ -1061,7 +1065,7 @@ bool CPluginManager::RunSecondPass(CPlugin *pPlugin, char *error, size_t maxleng
pPlugin->Call_OnPluginStart();
/* Now, if we have fake natives, go through all plugins that might need rebinding */
if (pPlugin->m_fakeNatives.size())
if (pPlugin->GetStatus() >= Plugin_Paused && pPlugin->m_fakeNatives.size())
{
List<CPlugin *>::iterator pl_iter;
CPlugin *pOther;

View File

@ -218,7 +218,7 @@ native bool:GetPluginInfo(Handle:plugin, PluginInfo:info, String:buffer[], maxle
*
* @param string Message to print.
* @noreturn
* @error Always.
* @error Always throws SP_ERROR_ABORT.
*/
native SetFailState(const String:string[]);