more localinfos

This commit is contained in:
Pavol Marko 2004-03-24 18:59:37 +00:00
parent 98c63e8efd
commit 130f274f86
4 changed files with 11 additions and 9 deletions

View File

@ -62,7 +62,7 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
// Find now folder
char pluginName[256], line[256], error[256];
const char pluginsDir[] = "addons/amxx/plugins"; // hardcoded; :TODO: make it localinfo
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
while ( fp.getline(line , 255 ) )

View File

@ -240,7 +240,8 @@ void print_srvconsole( char *fmt, ... );
void report_error( int code, char* fmt, ... );
void* alloc_amxmemory(void**, int size);
void free_amxmemory(void **ptr);
// get_localinfo
const char* get_localinfo( const char* name , const char* def );
#endif // AMXMODX_H

View File

@ -231,9 +231,10 @@ int Spawn( edict_t *pent ) {
g_commands.registerPrefix( "sm_" );
g_commands.registerPrefix( "cm_" );
// make sure basedir is set
// make sure localinfos are set
get_localinfo("amxx_basedir", "addons/amxx");
get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
get_localinfo("amxx_modulesdir", "addons/amxx/modules");
// ###### Load modules
loadModules(get_localinfo("amxx_modules", "addons/amxx/modules.ini"));
attachModules();

View File

@ -362,7 +362,7 @@ int loadModules(const char* filename)
if (!isalnum(*moduleName) || !validFile(moduleName) )
continue;
char* pathname = build_pathname("addons/amxx/modules/%s", line);
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
CList<CModule>::iterator a = g_modules.find( pathname );
@ -476,8 +476,8 @@ void dettachMetaModModules( const char* filename )
if (!isalnum(*moduleName) || !validFile(moduleName) )
continue;
char* pathname = build_pathname_addons("addons/amxx/modules/%s", line);
char* mmpathname = build_pathname_addons("addons/amxx/modules/%s", line);
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
module = DLLOAD( pathname ); // link dll
@ -520,8 +520,8 @@ void attachMetaModModules( const char* filename )
if (!isalnum(*moduleName) || !validFile(moduleName) )
continue;
char* pathname = build_pathname("addons/amxx/modules/%s", line);
char* mmpathname = build_pathname_addons("addons/amxx/modules/%s", line);
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
module = DLLOAD( pathname ); // link dll
if ( module )