From 36ec7bc818878929286f49b645bf1acf784a9a97 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 5 Jun 2006 18:48:01 +0000 Subject: [PATCH] fixed a very minor parsing bug in plugins.ini --- amxmodx/CPlugin.cpp | 23 +++++++++++++++++++++++ amxmodx/modules.cpp | 7 +++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/amxmodx/CPlugin.cpp b/amxmodx/CPlugin.cpp index de8327f3..18e15d63 100755 --- a/amxmodx/CPlugin.cpp +++ b/amxmodx/CPlugin.cpp @@ -108,6 +108,17 @@ int CPluginMngr::loadPluginsFromFile(const char* filename) line.clear(); line._fread(fp); + /** quick hack */ + char *ptr = const_cast(line.c_str()); + while (*ptr) + { + if (*ptr == ';') + { + *ptr = '\0'; + } else { + ptr++; + } + } sscanf(line.c_str(), "%s %s", pluginName, debug); if (!isalnum(*pluginName)) @@ -607,6 +618,18 @@ void CPluginMngr::CALMFromFile(const char *file) if (line[0] == ';' || line[0] == '\n' || line[0] == '\0') continue; + /** quick hack */ + char *ptr = line; + while (*ptr) + { + if (*ptr == ';') + { + *ptr = '\0'; + } else { + ptr++; + } + } + rline.assign(line); rline.trim(); pluginName[0] = '\0'; diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index abdffbc7..1a415064 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -478,8 +478,11 @@ int CheckModules(AMX *amx, char error[128]) if (!found) { - if (pHandler->HandleModule(buffer, (expect == LibType_Class))) - found = true; + if ((expect != LibType_Library) || !LoadModule(buffer, PT_ANYTIME)) + { + if (pHandler->HandleModule(buffer, (expect == LibType_Class))) + found = true; + } } if (!found)