]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
curl: change how failure/success is decided to prevent "black screen" problems if...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 15 Oct 2011 21:07:33 +0000 (21:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 15 Oct 2011 21:07:33 +0000 (21:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11421 d7cf8633-e32d-0410-b094-e92efae38249

libcurl.c

index 1cdd18b5bee2be46ea71a73f39235ddb7eafc090..7f1760595d87330d168b9daed21f727622be4e4a 100644 (file)
--- a/libcurl.c
+++ b/libcurl.c
@@ -308,20 +308,22 @@ static void Curl_CheckCommandWhenDone(void)
 {
        if(!curl_dll)
                return;
-       if(numdownloads_added && (numdownloads_success == numdownloads_added) && *command_when_done)
+       if(numdownloads_added && ((numdownloads_success + numdownloads_fail) == numdownloads_added))
        {
-               Con_DPrintf("cURL downloads occurred, executing %s\n", command_when_done);
-               Cbuf_AddText("\n");
-               Cbuf_AddText(command_when_done);
-               Cbuf_AddText("\n");
-               Curl_Clear_forthismap();
-       }
-       else if(numdownloads_added && numdownloads_fail && *command_when_error)
-       {
-               Con_DPrintf("cURL downloads FAILED, executing %s\n", command_when_error);
-               Cbuf_AddText("\n");
-               Cbuf_AddText(command_when_error);
-               Cbuf_AddText("\n");
+               if(numdownloads_fail == 0)
+               {
+                       Con_DPrintf("cURL downloads occurred, executing %s\n", command_when_done);
+                       Cbuf_AddText("\n");
+                       Cbuf_AddText(command_when_done);
+                       Cbuf_AddText("\n");
+               }
+               else
+               {
+                       Con_DPrintf("cURL downloads FAILED, executing %s\n", command_when_error);
+                       Cbuf_AddText("\n");
+                       Cbuf_AddText(command_when_error);
+                       Cbuf_AddText("\n");
+               }
                Curl_Clear_forthismap();
        }
 }