added request amb293 - SetFailState

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40843
This commit is contained in:
David Anderson
2007-05-23 01:44:00 +00:00
parent f4390609b3
commit 936337e54d
2 changed files with 22 additions and 0 deletions
+12
View File
@@ -246,6 +246,17 @@ static cell_t GetPluginInfo(IPluginContext *pContext, const cell_t *params)
return 1;
}
static cell_t SetFailState(IPluginContext *pContext, const cell_t *params)
{
char *str;
pContext->LocalToString(params[1], &str);
CPlugin *pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext());
pPlugin->SetErrorState(Plugin_Error, "%s", str);
return pContext->ThrowNativeErrorEx(SP_ERROR_ABORTED, "%s", str);
}
REGISTER_NATIVES(coreNatives)
{
{"GetPluginFilename", GetPluginFilename},
@@ -257,5 +268,6 @@ REGISTER_NATIVES(coreNatives)
{"MorePlugins", MorePlugins},
{"ReadPlugin", ReadPlugin},
{"ThrowError", ThrowError},
{"SetFailState", SetFailState},
{NULL, NULL},
};