Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug where OnPluginEnable would not know the current plugin
  • Loading branch information
nickgammon committed Nov 12, 2010
1 parent f8287c5 commit 253d854
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripting/methods/methods_plugins.cpp
Expand Up @@ -508,6 +508,11 @@ CPlugin * pPlugin = GetPlugin (PluginID);

pPlugin->m_bEnabled = Enabled != 0;

CPlugin * pSavedPlugin = m_CurrentPlugin;

// otherwise plugin won't know who itself is
m_CurrentPlugin = pPlugin;

if (pPlugin->m_bEnabled)
{
CScriptCallInfo callinfo (ON_PLUGIN_ENABLE, pPlugin->m_PluginCallbacks [ON_PLUGIN_ENABLE]);
Expand All @@ -519,6 +524,7 @@ CPlugin * pPlugin = GetPlugin (PluginID);
pPlugin->ExecutePluginScript (callinfo);
}

m_CurrentPlugin = pSavedPlugin;

return eOK;
} // end of CMUSHclientDoc::EnablePlugin
Expand Down

0 comments on commit 253d854

Please sign in to comment.