fixed inheritance not being used in the base menu style when removing clients from the watch list
3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #include "DebugReporter.h"
17 #include "PluginSys.h"
19 DebugReport g_DbgReporter;
21 void DebugReport::OnSourceModAllInitialized()
23 g_pSourcePawn->SetDebugListener(this);
26 void DebugReport::OnContextExecuteError(IPluginContext *ctx, IContextTrace *error)
29 const char *plname = g_PluginSys.FindPluginByContext(ctx->GetContext())->GetFilename();
30 int n_err = error->GetErrorCode();
32 if (n_err != SP_ERROR_NATIVE)
34 g_Logger.LogError("[SM] Plugin \"%s\" encountered error %d: %s",
37 error->GetErrorString());
40 if ((lastname=error->GetLastNative(NULL)) != NULL)
43 if ((custerr=error->GetCustomErrorString()) != NULL)
45 g_Logger.LogError("[SM] Native \"%s\" reported: %s", lastname, custerr);
47 g_Logger.LogError("[SM] Native \"%s\" encountered a generic error.", lastname);
51 if (!error->DebugInfoAvailable())
53 g_Logger.LogError("[SM] Debug mode is not enabled for this plugin.");
54 g_Logger.LogError("[SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug %d on",
55 _GetPluginIndex(ctx));
59 CallStackInfo stk_info;
61 g_Logger.LogError("[SM] Displaying call stack trace:");
62 while (error->GetTraceInfo(&stk_info))
64 g_Logger.LogError("[SM] [%d] Line %d, %s::%s()",
72 int DebugReport::_GetPluginIndex(IPluginContext *ctx)
75 IPluginIterator *iter = g_PluginSys.GetPluginIterator();
77 for (; iter->MorePlugins(); iter->NextPlugin(), id++)
79 IPlugin *pl = iter->GetPlugin();
80 if (pl->GetBaseContext() == ctx)