]> 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)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 15 Oct 2011 20:57:14 +0000 (22:57 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11421 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=416a6242fb6d9e6676da2ff28d6b33478f84d3fe

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();
        }
 }