Skip to content

Commit 253d854

Browse files
committed
Fixed bug where OnPluginEnable would not know the current plugin
1 parent f8287c5 commit 253d854

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripting/methods/methods_plugins.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,11 @@ CPlugin * pPlugin = GetPlugin (PluginID);
508508

509509
pPlugin->m_bEnabled = Enabled != 0;
510510

511+
CPlugin * pSavedPlugin = m_CurrentPlugin;
512+
513+
// otherwise plugin won't know who itself is
514+
m_CurrentPlugin = pPlugin;
515+
511516
if (pPlugin->m_bEnabled)
512517
{
513518
CScriptCallInfo callinfo (ON_PLUGIN_ENABLE, pPlugin->m_PluginCallbacks [ON_PLUGIN_ENABLE]);
@@ -519,6 +524,7 @@ CPlugin * pPlugin = GetPlugin (PluginID);
519524
pPlugin->ExecutePluginScript (callinfo);
520525
}
521526

527+
m_CurrentPlugin = pSavedPlugin;
522528

523529
return eOK;
524530
} // end of CMUSHclientDoc::EnablePlugin

0 commit comments

Comments
 (0)