-#ifdef WIN32
- dllhandle = LoadLibrary (temp);
-#else
- dllhandle = dlopen (temp, RTLD_LAZY | RTLD_GLOBAL);
-#endif
- if (Sys_LoadLibraryFunctions(dllhandle, fcts, true, dllnames[i+1] != NULL))
- break;
- else
- Sys_FreeLibrary (&dllhandle);
+
+ if(Sys_LoadLibrary(temp, &dllhandle))
+ {
+ if (Sys_LoadDependencyFunctions(dllhandle, fcts, true, (dllnames[i+1] != NULL) || (strrchr(sys.argv[0], '/'))))
+ break;
+ else
+ Sys_FreeLibrary (&dllhandle);
+ }