Permalink
Browse files

Improve CreateNative failure message (#903)

This confuses everyone.
  • Loading branch information...
asherkin committed Oct 10, 2018
1 parent 6eb319f commit 7dd733cf46ab781ce548fe1c7b1a16f8606d3147
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/logic/smn_fakenatives.cpp
@@ -113,14 +113,14 @@ static cell_t CreateNative(IPluginContext *pContext, const cell_t *params)
IPluginFunction *pFunction = pContext->GetFunctionById(params[2]);
if (!pFunction)
{
return pContext->ThrowNativeError("Function %x is not a valid function", params[2]);
return pContext->ThrowNativeError("Failed to create native \"%s\", function %x is not a valid function", name, params[2]);
}

pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext());

if (!pPlugin->AddFakeNative(pFunction, name, FakeNativeRouter))
{
return pContext->ThrowNativeError("Fatal error creating dynamic native!");
return pContext->ThrowNativeError("Failed to create native \"%s\", name is probably already in use", name);
}

return 1;

0 comments on commit 7dd733c

Please sign in to comment.