From 9b2e77711aedf663cb753a97f8a53bcd4aec5804 Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Wed, 29 Oct 2014 17:13:43 +0100 Subject: [PATCH] Plugin_Failed == "An unrecoverable error" Change the meaning of Plugin_Failed status to indicate, that the plugin can't recover from the error. Make sure those previously loaded plugins are shown correctly in sm plugins info x. --- core/logic/PluginSys.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/logic/PluginSys.cpp b/core/logic/PluginSys.cpp index a22544df..ae7935f1 100644 --- a/core/logic/PluginSys.cpp +++ b/core/logic/PluginSys.cpp @@ -1147,7 +1147,7 @@ void CPluginManager::LoadAll_SecondPass() if (!RunSecondPass(pPlugin, error, sizeof(error))) { g_Logger.LogError("[SM] Unable to load plugin \"%s\": %s", pPlugin->GetFilename(), error); - pPlugin->SetErrorState(Plugin_Failed, "%s", error); + pPlugin->SetErrorState(Plugin_BadLoad, "%s", error); } } } @@ -2224,7 +2224,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c const sm_plugininfo_t *info = pl->GetPublicInfo(); rootmenu->ConsolePrint(" Filename: %s", pl->GetFilename()); - if (pl->GetStatus() <= Plugin_Error) + if (pl->GetStatus() <= Plugin_Error || pl->GetStatus() == Plugin_Failed) { if (IS_STR_FILLED(info->name)) { @@ -2247,7 +2247,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c { rootmenu->ConsolePrint(" URL: %s", info->url); } - if (pl->GetStatus() == Plugin_Error) + if (pl->GetStatus() == Plugin_Error || pl->GetStatus() == Plugin_Failed) { rootmenu->ConsolePrint(" Error: %s", pl->m_errormsg); }