diff -r c991c043022d -r db7c6362f3f2 core/smn_core.cpp --- a/core/smn_core.cpp Thu Jul 10 01:26:02 2008 +0000 +++ b/core/smn_core.cpp Fri Jul 11 08:18:43 2008 +0000 @@ -130,7 +130,7 @@ g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 1); - if (pContext->GetContext()->n_err == SP_ERROR_NONE) + if (pContext->GetLastNativeError() == SP_ERROR_NONE) { pContext->ThrowNativeErrorEx(SP_ERROR_ABORTED, "%s", buffer); } @@ -387,7 +387,7 @@ char buffer[2048]; g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 1); - if (pContext->GetContext()->n_err != SP_ERROR_NONE) + if (pContext->GetLastNativeError() != SP_ERROR_NONE) { pPlugin->SetErrorState(Plugin_Error, "%s", str); return pContext->ThrowNativeErrorEx(SP_ERROR_ABORTED, "Formatting error (%s)", str); @@ -455,7 +455,7 @@ { char *name; uint32_t idx; - sp_context_t *ctx = pContext->GetContext(); + sp_native_t *native; pContext->LocalToString(params[1], &name); if (pContext->FindNativeByName(name, &idx) != SP_ERROR_NONE) @@ -464,7 +464,9 @@ return 0; } - ctx->natives[idx].flags |= SP_NTVFLAG_OPTIONAL; + pContext->GetNativeByIndex(idx, &native); + + native->flags |= SP_NTVFLAG_OPTIONAL; return 1; } @@ -505,7 +507,7 @@ g_SourceMod.SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE); g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 3); - if (pContext->GetContext()->n_err != SP_ERROR_NONE) + if (pContext->GetLastNativeError() != SP_ERROR_NONE) { return 0; } @@ -535,7 +537,7 @@ g_SourceMod.SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE); g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2); - if (pContext->GetContext()->n_err != SP_ERROR_NONE) + if (pContext->GetLastNativeError() != SP_ERROR_NONE) { fclose(fp); return 0; @@ -568,7 +570,7 @@ g_SourceMod.SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE); g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2); - if (pContext->GetContext()->n_err != SP_ERROR_NONE) + if (pContext->GetLastNativeError() != SP_ERROR_NONE) { fclose(fp); return 0;