removed unused option to set first level of user level sets not to be '1'
authorHolger Schemel <info@artsoft.org>
Tue, 17 Oct 2017 19:42:26 +0000 (21:42 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:14 +0000 (23:21 +0100)
src/editor.c
src/libgame/setup.c
src/libgame/setup.h

index 9677a17cfc1e018891b785b05945d7cb31ca1988..cef0b2875b2430259ceef346eea90e00777abd1a 100644 (file)
@@ -1297,7 +1297,6 @@ static struct ElementInfo custom_element;
 static char levelset_name[MAX_LEVEL_NAME_LEN + 1];
 static char levelset_author[MAX_LEVEL_AUTHOR_LEN + 1];
 static int levelset_num_levels = 100;
-static int levelset_first_level_nr = 1;
 static int levelset_save_mode = LEVELSET_SAVE_MODE_UPDATE;
 
 static struct
@@ -7591,7 +7590,7 @@ static void ModifyLevelInfoForSavingIntoPersonalLevelSet(char *former_name)
   }
 
   if (level_nr > leveldir_current->last_level)
-    UpdateUserLevelSet(getLoginName(), NULL, NULL, level_nr + 9, -1);
+    UpdateUserLevelSet(getLoginName(), NULL, NULL, level_nr + 9);
 
   // else: allow the save even if annotation failed
 
@@ -8230,8 +8229,7 @@ static void InitLevelSetInfo()
   snprintf(levelset_author, MAX_LEVEL_AUTHOR_LEN + 1,
           "%s", leveldir_current->author);
 
-  levelset_num_levels     = leveldir_current->levels;
-  levelset_first_level_nr = leveldir_current->first_level;
+  levelset_num_levels = leveldir_current->levels;
 
   levelset_save_mode = LEVELSET_SAVE_MODE_UPDATE;
 }
@@ -12640,8 +12638,7 @@ static void HandleTextbuttonGadgets(struct GadgetInfo *gi)
       if (UpdateUserLevelSet(levelset_subdir,
                             levelset_name,
                             levelset_author,
-                            levelset_num_levels,
-                            levelset_first_level_nr))
+                            levelset_num_levels))
       {
        Request("Level set updated!", REQ_CONFIRM);
       }
@@ -12655,8 +12652,7 @@ static void HandleTextbuttonGadgets(struct GadgetInfo *gi)
       if (CreateUserLevelSet(levelset_subdir,
                             levelset_name,
                             levelset_author,
-                            levelset_num_levels,
-                            1))
+                            levelset_num_levels))
       {
        Request("New level set created!", REQ_CONFIRM);
 
index 80d224e5747fe3f6eeedf77808e168c159541c87..8662b204bb5f336ca426408be1b2fe841efa58a7 100644 (file)
@@ -3559,9 +3559,8 @@ void AddUserLevelSetToLevelInfo(char *level_subdir_new)
     Error(ERR_EXIT, "internal level set structure corrupted -- aborting");
 }
 
-boolean UpdateUserLevelSet(char *level_subdir,
-                          char *level_name, char *level_author,
-                          int num_levels, int first_level_nr)
+boolean UpdateUserLevelSet(char *level_subdir, char *level_name,
+                          char *level_author, int num_levels)
 {
   char *filename = getPath2(getUserLevelDir(level_subdir), LEVELINFO_FILENAME);
   char *filename_tmp = getStringCat2(filename, ".tmp");
@@ -3582,9 +3581,6 @@ boolean UpdateUserLevelSet(char *level_subdir,
   if (num_levels != -1)
     leveldir->levels = num_levels;
 
-  if (first_level_nr != -1)
-    leveldir->first_level = first_level_nr;
-
   // update values that depend on other values
 
   setString(&leveldir->name_sorting, leveldir->name);
@@ -3605,8 +3601,6 @@ boolean UpdateUserLevelSet(char *level_subdir,
        fprintf(file_tmp, "%-32s%s\n", "author:", level_author);
       else if (strPrefix(line, "levels:") && num_levels != -1)
        fprintf(file_tmp, "%-32s%d\n", "levels:", num_levels);
-      else if (strPrefix(line, "first_level:") && first_level_nr != -1)
-       fprintf(file_tmp, "%-32s%d\n", "first_level:", first_level_nr);
       else
        fputs(line, file_tmp);
     }
@@ -3629,9 +3623,8 @@ boolean UpdateUserLevelSet(char *level_subdir,
   return success;
 }
 
-boolean CreateUserLevelSet(char *level_subdir,
-                          char *level_name, char *level_author,
-                          int num_levels, int first_level_nr)
+boolean CreateUserLevelSet(char *level_subdir, char *level_name,
+                          char *level_author, int num_levels)
 {
   LevelDirTree *level_info;
   char *filename;
@@ -3659,7 +3652,7 @@ boolean CreateUserLevelSet(char *level_subdir,
   setString(&level_info->name, level_name);
   setString(&level_info->author, level_author);
   level_info->levels = num_levels;
-  level_info->first_level = first_level_nr;
+  level_info->first_level = 1;
   level_info->sort_priority = LEVELCLASS_PRIVATE_START;
   level_info->readonly = FALSE;
 
@@ -3698,7 +3691,7 @@ boolean CreateUserLevelSet(char *level_subdir,
 
 static void SaveUserLevelInfo()
 {
-  CreateUserLevelSet(getLoginName(), getLoginName(), getRealName(), 100, 1);
+  CreateUserLevelSet(getLoginName(), getLoginName(), getRealName(), 100);
 }
 
 char *getSetupValue(int type, void *value)
index 7e45cb5ae9e8a279156f32102167966caccfe75d..f7b7892859c813c1d01d4f1b44ec8ac9a72a6488 100644 (file)
@@ -312,8 +312,8 @@ void LoadArtworkInfo(void);
 void LoadLevelArtworkInfo(void);
 
 void AddUserLevelSetToLevelInfo(char *);
-boolean UpdateUserLevelSet(char *, char *, char *, int, int);
-boolean CreateUserLevelSet(char *, char *, char *, int, int);
+boolean UpdateUserLevelSet(char *, char *, char *, int);
+boolean CreateUserLevelSet(char *, char *, char *, int);
 
 void LoadLevelSetup_LastSeries(void);
 void SaveLevelSetup_LastSeries(void);