Changed how plugins.ini is read
This commit is contained in:
parent
b7c0c47c05
commit
f9a57a83a0
|
@ -50,7 +50,7 @@ void CPluginMngr::unloadPlugin( CPlugin** a ) {
|
|||
|
||||
int CPluginMngr::loadPluginsFromFile( const char* filename )
|
||||
{
|
||||
File fp( build_pathname("%s",filename) , "r" );
|
||||
FILE *fp = fopen(build_pathname("%s",filename) , "rt");
|
||||
|
||||
if ( !fp )
|
||||
{
|
||||
|
@ -59,17 +59,20 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
|
|||
}
|
||||
|
||||
// Find now folder
|
||||
char pluginName[256], line[256], error[256], debug[256];
|
||||
char pluginName[256], error[256], debug[256];
|
||||
int debugFlag = 0;
|
||||
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxmodx/plugins");
|
||||
|
||||
String line;
|
||||
|
||||
while ( fp.getline(line , 255 ) )
|
||||
while ( !feof(fp) )
|
||||
{
|
||||
*pluginName = 0;
|
||||
*debug = 0;
|
||||
debugFlag = 0;
|
||||
sscanf(line,"%s %s",pluginName, debug);
|
||||
line.clear();
|
||||
line._fread(fp);
|
||||
sscanf(line.c_str(),"%s %s",pluginName, debug);
|
||||
if (!isalnum(*pluginName)) continue;
|
||||
|
||||
if (isalnum(*debug) && strcmp(debug, "debug") == 0)
|
||||
|
@ -88,6 +91,8 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
|
|||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return pCounter;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user