fixed endless loop if stopping tape while auto-playing
[rocksndiamonds.git] / src / screens.c
index a1470f20dd5a6c305f169c598767144485406837..fb6b4e76976952219a1015710389d65fe6dbb38a 100644 (file)
@@ -2232,9 +2232,13 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button)
        SaveLevelSetup_LastSeries();
        SaveLevelSetup_SeriesInfo();
 
+#if defined(PLATFORM_EMSCRIPTEN)
+       Request("Close the browser window to quit!", REQ_CONFIRM);
+#else
        if (!setup.ask_on_quit_program ||
            Request("Do you really want to quit?", REQ_ASK | REQ_STAY_CLOSED))
          SetGameStatus(GAME_MODE_QUIT);
+#endif
       }
     }
   }
@@ -4352,10 +4356,17 @@ static void setTypeNameValues(char *name, struct TextPosInfo *pos,
     // temporarily change active user to edited user
     user.nr = type_name_nr;
 
-    // load setup of edited user (unless creating user with current setup)
-    if (!create_user ||
-       !Request("Use current setup values for the new player?", REQ_ASK))
+    if (create_user &&
+        Request("Use current setup values for the new player?", REQ_ASK))
+    {
+      // use current setup values for new user, but create new player UUID
+      setup.player_uuid = getStringCopy(getUUID());
+    }
+    else
+    {
+      // load setup for existing user (or start with defaults for new user)
       LoadSetup();
+    }
   }
 
   char *setup_filename = getSetupFilename();