fixed a very minor parsing bug in plugins.ini

This commit is contained in:
David Anderson 2006-06-05 18:48:01 +00:00
parent b4450bbee5
commit 36ec7bc818
2 changed files with 28 additions and 2 deletions

View File

@ -108,6 +108,17 @@ int CPluginMngr::loadPluginsFromFile(const char* filename)
line.clear();
line._fread(fp);
/** quick hack */
char *ptr = const_cast<char *>(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';

View File

@ -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)