Skip to content

Commit

Permalink
Fixed bug where plugins would not save their state
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Sep 25, 2010
1 parent cb209c5 commit d65fc5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins.cpp
Expand Up @@ -780,6 +780,8 @@ bool bError = true;

} // end of no save state folder

CPlugin * oldPlugin = m_pDoc->m_CurrentPlugin;
m_pDoc->m_CurrentPlugin = this;

CScriptCallInfo callinfo (ON_PLUGIN_SAVE_STATE, m_PluginCallbacks [ON_PLUGIN_SAVE_STATE]);
ExecutePluginScript (callinfo);
Expand All @@ -789,7 +791,6 @@ bool bError = true;
strFilename += m_strID; // plugin ID
strFilename += "-state.xml"; // suffix

CPlugin * oldPlugin = m_pDoc->m_CurrentPlugin;

try
{
Expand All @@ -802,7 +803,6 @@ bool bError = true;
(LPCTSTR) m_strName,
(LPCTSTR) m_pDoc->m_mush_name);

m_pDoc->m_CurrentPlugin = this;
m_pDoc->Save_World_XML (*ar, XML_VARIABLES, strComment);

bError = false;
Expand Down

0 comments on commit d65fc5a

Please sign in to comment.