fixed a very minor parsing bug in plugins.ini
This commit is contained in:
parent
b4450bbee5
commit
36ec7bc818
|
@ -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';
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user