swapped condition logic to improve code readability
authorHolger Schemel <info@artsoft.org>
Wed, 29 Sep 2021 22:54:25 +0000 (00:54 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 29 Sep 2021 22:54:25 +0000 (00:54 +0200)
src/screens.c

index 0cb8a2b017ab8d05e10f0f757a353c17d4d158ab..fb6b4e76976952219a1015710389d65fe6dbb38a 100644 (file)
@@ -4356,12 +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))
-      LoadSetup();
-    else
+    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();