diff -r 2a6bbf305c17 -r d36c45088e36 core/systems/PluginSys.cpp --- a/core/systems/PluginSys.cpp Wed Feb 21 22:09:05 2007 +0000 +++ b/core/systems/PluginSys.cpp Thu Feb 22 02:05:50 2007 +0000 @@ -202,7 +202,6 @@ } m_ctx.base = new BaseContext(m_ctx.ctx); - m_ctx.base->SetRunnable(false); m_ctx.ctx->user[SM_CONTEXTVAR_MYSELF] = (void *)this; m_status = Plugin_Created; @@ -222,9 +221,9 @@ vsnprintf(m_errormsg, sizeof(m_errormsg), error_fmt, ap); va_end(ap); - if (m_ctx.base) + if (m_ctx.ctx) { - m_ctx.base->SetRunnable(false); + m_ctx.ctx->flags |= SPFLAG_PLUGIN_PAUSED; } } @@ -310,7 +309,6 @@ } m_status = Plugin_Loaded; - m_ctx.base->SetRunnable(true); int err; cell_t result; @@ -397,8 +395,6 @@ return false; } - m_status = (paused) ? Plugin_Paused : Plugin_Running; - IPluginFunction *pFunction = m_ctx.base->GetFunctionByName("OnPluginPauseChange"); if (pFunction) { @@ -407,6 +403,15 @@ pFunction->Execute(&result); } + if (paused) + { + m_status = Plugin_Paused; + m_ctx.ctx->flags |= SPFLAG_PLUGIN_PAUSED; + } else { + m_status = Plugin_Running; + m_ctx.ctx->flags &= ~SPFLAG_PLUGIN_PAUSED; + } + g_PluginSys._SetPauseState(this, paused); return true;