diff --git a/code/client/cl_curl.c b/code/client/cl_curl.c index 3b4dad05..b8508248 100644 --- a/code/client/cl_curl.c +++ b/code/client/cl_curl.c @@ -94,11 +94,11 @@ qboolean CL_cURL_Init() Com_Printf("Loading \"%s\"...", cl_cURLLib->string); - if(!(cURLLib = Sys_LoadDll(cl_cURLLib->string))) + if(!(cURLLib = Sys_LoadDll(cl_cURLLib->string, qtrue))) { #ifdef ALTERNATE_CURL_LIB // On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too. - if(!(cURLLib = Sys_LoadDll(ALTERNATE_CURL_LIB))) + if(!(cURLLib = Sys_LoadDll(ALTERNATE_CURL_LIB, qtrue))) #endif return qfalse; } diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 765c106b..52e0ed7d 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -3182,7 +3182,7 @@ void CL_InitRef( void ) { Com_sprintf(dllName, sizeof(dllName), "renderer_%s_" ARCH_STRING DLL_EXT, cl_renderer->string); - if(!(rendererLib = Sys_LoadDll(dllName)) && strcmp(cl_renderer->string, cl_renderer->resetString)) + if(!(rendererLib = Sys_LoadDll(dllName, qfalse)) && strcmp(cl_renderer->string, cl_renderer->resetString)) { Cvar_ForceReset("cl_renderer"); diff --git a/code/client/qal.c b/code/client/qal.c index 9b016038..eb225512 100644 --- a/code/client/qal.c +++ b/code/client/qal.c @@ -144,7 +144,7 @@ qboolean QAL_Init(const char *libname) if(OpenALLib) return qtrue; - if(!(OpenALLib = Sys_LoadDll(libname))) + if(!(OpenALLib = Sys_LoadDll(libname, qtrue))) return qfalse; alinit_fail = qfalse; diff --git a/code/sys/sys_loadlib.h b/code/sys/sys_loadlib.h index 2c4ddd04..0b1eac3e 100644 --- a/code/sys/sys_loadlib.h +++ b/code/sys/sys_loadlib.h @@ -48,4 +48,4 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # define Sys_LibraryError() SDL_GetError() #endif -void * QDECL Sys_LoadDll(const char *name); +void * QDECL Sys_LoadDll(const char *name, qboolean useSystemLib); diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c index 5fbb6f8c..3f440aa9 100644 --- a/code/sys/sys_main.c +++ b/code/sys/sys_main.c @@ -417,12 +417,14 @@ from executable path, then fs_basepath. ================= */ -void *Sys_LoadDll(const char *name) +void *Sys_LoadDll(const char *name, qboolean useSystemLib) { void *dllhandle; - Com_Printf("Try loading \"%s\"...\n", name); - if(!(dllhandle = Sys_LoadLibrary(name))) + if(useSystemLib) + Com_Printf("Try loading \"%s\"...\n", name); + + if(!useSystemLib || !(dllhandle = Sys_LoadLibrary(name))) { const char *topDir; char libPath[MAX_OSPATH];