MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / _GetPluginIndex

Method _GetPluginIndex

core/logic/DebugReporter.cpp:99–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99int DebugReport::_GetPluginIndex(IPluginContext *ctx)
100{
101 int id = 1;
102 IPluginIterator *iter = pluginsys->GetPluginIterator();
103
104 for (; iter->MorePlugins(); iter->NextPlugin(), id++)
105 {
106 IPlugin *pl = iter->GetPlugin();
107 if (pl->GetBaseContext() == ctx)
108 {
109 iter->Release();
110 return id;
111 }
112 }
113
114 iter->Release();
115
116 /* If we don't know which plugin this is, it's one being loaded. Fake its index for now. */
117
118 return pluginsys->GetPluginCount() + 1;
119}
120
121void DebugReport::ReportError(const IErrorReport &report, IFrameIterator &iter)
122{

Callers

nothing calls this directly

Calls 7

GetBaseContextMethod · 0.80
GetPluginIteratorMethod · 0.45
MorePluginsMethod · 0.45
NextPluginMethod · 0.45
GetPluginMethod · 0.45
ReleaseMethod · 0.45
GetPluginCountMethod · 0.45

Tested by

no test coverage detected