1.1 --- a/sourcemm/CSmmAPI.cpp Fri Apr 06 02:47:41 2007 +0000
1.2 +++ b/sourcemm/CSmmAPI.cpp Fri Apr 06 20:53:07 2007 +0000
1.3 @@ -454,39 +454,15 @@
1.4
1.5 void CSmmAPI::LoadAsVSP()
1.6 {
1.7 - g_Engine.engine->ServerCommand("plugin_load \n");
1.8 - g_Engine.engine->ServerExecute();
1.9 -
1.10 - IServerPluginCallbacks *iface = NULL;
1.11 - if (g_VspListener.IsLoaded())
1.12 - {
1.13 - iface = &g_VspListener;
1.14 - }
1.15 -
1.16 - PluginIter iter;
1.17 - CPluginManager::CPlugin *pPlugin;
1.18 - SourceHook::List<IMetamodListener *>::iterator event;
1.19 - IMetamodListener *pML;
1.20 - for (iter=g_PluginMngr._begin(); iter!=g_PluginMngr._end(); iter++)
1.21 + char path[260];
1.22 + if (!GetFileOfAddress(CreateInterface, path, sizeof(path)))
1.23 {
1.24 - pPlugin = (*iter);
1.25 - if (pPlugin->m_Status < Pl_Paused)
1.26 - {
1.27 - continue;
1.28 - }
1.29 - /* Only valid for plugins >= 10 (v1:5, SourceMM 1.4) */
1.30 - if (pPlugin->m_API->GetApiVersion() < 10)
1.31 - {
1.32 - continue;
1.33 - }
1.34 - for (event=pPlugin->m_Events.begin();
1.35 - event!=pPlugin->m_Events.end();
1.36 - event++)
1.37 - {
1.38 - pML = (*event);
1.39 - pML->OnVSPListening(iface);
1.40 - }
1.41 + /* Failed! */
1.42 }
1.43 + char command[350];
1.44 + g_VspListener.SetLoadable(true);
1.45 + UTIL_Format(command, sizeof(command), "plugin_load \"%s\"\n", path);
1.46 + g_Engine.engine->ServerCommand(command);
1.47 }
1.48
1.49 void CSmmAPI::EnableVSPListener()