Use internal sp::Environment directly in core/logic.

Also remove ISourcePawnEngine and ISourcePawnEngine2 pointers since
they're now redundant.
This commit is contained in:
David Anderson
2026-05-17 15:22:58 -07:00
parent fba9d713b7
commit 890c7119fe
35 changed files with 130 additions and 167 deletions
+5 -4
View File
@@ -34,12 +34,13 @@
#include <stdarg.h>
#include "DebugReporter.h"
#include "Logger.h"
#include "sourcepawn/vm/environment.h"
DebugReport g_DbgReporter;
void DebugReport::OnSourceModAllInitialized()
{
g_pSourcePawn->SetDebugListener(this);
g_pPawnEnv->SetDebugListener(this);
}
void DebugReport::OnDebugSpew(const char *msg, ...)
@@ -68,10 +69,10 @@ void DebugReport::GenerateErrorVA(IPluginContext *ctx, cell_t func_idx, int err,
char buffer[512];
ke::SafeVsprintf(buffer, sizeof(buffer), message, ap);
const char *plname = pluginsys->FindPluginByContext(ctx->GetContext())->GetFilename();
const char *plname = pluginsys->FindPluginByContext(ctx)->GetFilename();
if (err >= 0) {
const char *error = g_pSourcePawn2->GetErrorString(err);
const char *error = g_pPawnEnv->GetErrorString(err);
if (error)
g_Logger.LogError("[SM] Plugin \"%s\" encountered error %d: %s", plname, err, error);
else
@@ -134,7 +135,7 @@ void DebugReport::ReportError(const IErrorReport &report, IFrameIterator &iter)
{
if (iter.IsScriptedFrame())
{
IPlugin *plugin = pluginsys->FindPluginByContext(iter.Context()->GetContext());
IPlugin *plugin = pluginsys->FindPluginByContext(iter.Context());
if (plugin)
{
blame = plugin->GetFilename();