From 4ba1f6db099cdc734ed4d58cbb2395cd65efb726 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sat, 12 Jul 2014 23:02:51 +0200 Subject: load libraries only, and load VMs additionally, from the path specified by the fs_overpath cvar --- src/sys/sys_main.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) (limited to 'src/sys') diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c index e5d93546..45b2f6ba 100644 --- a/src/sys/sys_main.c +++ b/src/sys/sys_main.c @@ -459,34 +459,20 @@ void *Sys_LoadDll(const char *name, qboolean useSystemLib) if(!useSystemLib || !(dllhandle = Sys_LoadLibrary(name))) { - const char *topDir; - char libPath[MAX_OSPATH]; + const char *overpath = Cvar_VariableString("fs_overpath"); - topDir = Sys_BinaryPath(); - - if(!*topDir) - topDir = "."; - - Com_Printf("Trying to load \"%s\" from \"%s\"...\n", name, topDir); - Com_sprintf(libPath, sizeof(libPath), "%s%c%s", topDir, PATH_SEP, name); - - if(!(dllhandle = Sys_LoadLibrary(libPath))) + if(overpath[0]) { - const char *basePath = Cvar_VariableString("fs_basepath"); - - if(!basePath || !*basePath) - basePath = "."; - - if(FS_FilenameCompare(topDir, basePath)) - { - Com_Printf("Trying to load \"%s\" from \"%s\"...\n", name, basePath); - Com_sprintf(libPath, sizeof(libPath), "%s%c%s", basePath, PATH_SEP, name); - dllhandle = Sys_LoadLibrary(libPath); - } - - if(!dllhandle) - Com_Printf("Loading \"%s\" failed\n", name); + char libPath[MAX_OSPATH]; + Com_Printf("Trying to load \"%s\" from \"%s\"...\n", name, overpath); + Com_sprintf(libPath, sizeof(libPath), "%s%c%s", overpath, PATH_SEP, name); + dllhandle = Sys_LoadLibrary(libPath); } + else + dllhandle = NULL; + + if(!dllhandle) + Com_Printf("Loading \"%s\" failed\n", name); } return dllhandle; -- cgit