added asking for and uploading tapes to score server after changing user
[rocksndiamonds.git] / src / screens.c
index fb6b4e76976952219a1015710389d65fe6dbb38a..47777fa23d825d853309e856707f24e64023208a 100644 (file)
@@ -5116,6 +5116,9 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
          SetGameStatus(GAME_MODE_MAIN);
 
          DrawMainMenu();
+
+         // needed once to offer uploading score tapes after changing user
+         CheckUploadTapes();
        }
       }
     }
@@ -9987,7 +9990,19 @@ static boolean OfferUploadTapes(void)
   int num_tapes_uploaded = UploadTapes();
   char message[100];
 
-  sprintf(message, "%d tapes uploaded!", num_tapes_uploaded);
+  if (num_tapes_uploaded < 0)
+  {
+    Request("Cannot upload tapes to score server!", REQ_CONFIRM);
+
+    return FALSE;
+  }
+
+  if (num_tapes_uploaded == 0)
+    sprintf(message, "No tapes uploaded!");
+  else if (num_tapes_uploaded == 1)
+    sprintf(message, "1 tape uploaded!");
+  else
+    sprintf(message, "%d tapes uploaded!", num_tapes_uploaded);
 
   Request(message, REQ_CONFIRM);
 
@@ -9996,7 +10011,7 @@ static boolean OfferUploadTapes(void)
 
   SaveSetup();
 
-  return (num_tapes_uploaded > 0);
+  return TRUE;
 }
 
 void CheckUploadTapes(void)