1.1 --- a/core/smn_fakenatives.cpp Mon May 26 07:48:26 2008 +0000
1.2 +++ b/core/smn_fakenatives.cpp Mon May 26 07:51:11 2008 +0000
1.3 @@ -113,6 +113,8 @@
1.4 static cell_t CreateNative(IPluginContext *pContext, const cell_t *params)
1.5 {
1.6 char *name;
1.7 + CPlugin *pPlugin;
1.8 +
1.9 pContext->LocalToString(params[1], &name);
1.10
1.11 IPluginFunction *pFunction = pContext->GetFunctionById(params[2]);
1.12 @@ -121,7 +123,9 @@
1.13 return pContext->ThrowNativeError("Function %x is not a valid function", params[2]);
1.14 }
1.15
1.16 - if (!g_PluginSys.AddFakeNative(pFunction, name, FakeNativeRouter))
1.17 + pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext());
1.18 +
1.19 + if (!pPlugin->AddFakeNative(pFunction, name, FakeNativeRouter))
1.20 {
1.21 return pContext->ThrowNativeError("Fatal error creating dynamic native!");
1.22 }