]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - libcurl.c
added libpng.so fallback name, primarily for FreeBSD
[xonotic/darkplaces.git] / libcurl.c
index e37d40d421f4baad78411cad3dac020e0a553560..9db850e5cf34325dfc1d66289fa3f262c59a9fbd 100644 (file)
--- a/libcurl.c
+++ b/libcurl.c
@@ -198,7 +198,8 @@ static qboolean CURL_OpenLibrary (void)
 #elif defined(WIN32)
                "libcurl-3.dll",
 #elif defined(MACOSX)
-               "libcurl.3.dylib",
+               "libcurl.3.dylib", // Mac OS X Tiger
+               "libcurl.2.dylib", // Mac OS X Panther
 #else
                "libcurl.so.3",
 #endif
@@ -349,7 +350,10 @@ static void Curl_EndDownload(downloadinfo *di, CurlStatus status, CURLcode error
        {
                ok = FS_AddPack(di->filename, NULL, true);
                if(ok && di->forthismap)
+               {
                        Mod_Reload();
+                       R_Modules_NewMap();
+               }
        }
 
        if(!ok && di->forthismap)
@@ -559,7 +563,10 @@ void Curl_Begin(const char *URL, const char *name, qboolean ispak, qboolean fort
                                        Con_DPrintf("(pak was already loaded)\n");
                                else
                                        if(forthismap)
+                                       {
                                                Mod_Reload();
+                                               R_Modules_NewMap();
+                                       }
                                return;
                        }
                        else
@@ -1152,8 +1159,7 @@ void Curl_SendRequirements()
        // for each requirement, find the pack name
        char sendbuffer[4096] = "";
        requirement *req;
-
-       strlcat(sendbuffer, "curl --clear_autodownload\n", sizeof(sendbuffer));
+       qboolean foundone = false;
 
        for(req = requirements; req; req = req->next)
        {
@@ -1172,6 +1178,9 @@ void Curl_SendRequirements()
 
                if(packurl && *packurl && strcmp(packurl, "-"))
                {
+                       if(!foundone)
+                               strlcat(sendbuffer, "curl --clear_autodownload\n", sizeof(sendbuffer));
+
                        strlcat(sendbuffer, "curl --pak --forthismap --as ", sizeof(sendbuffer));
                        strlcat(sendbuffer, thispack, sizeof(sendbuffer));
                        strlcat(sendbuffer, " --for ", sizeof(sendbuffer));
@@ -1180,10 +1189,13 @@ void Curl_SendRequirements()
                        strlcat(sendbuffer, packurl, sizeof(sendbuffer));
                        strlcat(sendbuffer, thispack, sizeof(sendbuffer));
                        strlcat(sendbuffer, "\n", sizeof(sendbuffer));
+
+                       foundone = true;
                }
        }
 
-       strlcat(sendbuffer, "curl --finish_autodownload\n", sizeof(sendbuffer));
+       if(foundone)
+               strlcat(sendbuffer, "curl --finish_autodownload\n", sizeof(sendbuffer));
 
        if(strlen(sendbuffer) + 1 < sizeof(sendbuffer))
                Host_ClientCommands("%s", sendbuffer);