From: Holger Schemel Date: Tue, 17 Oct 2017 19:42:26 +0000 (+0200) Subject: removed unused option to set first level of user level sets not to be '1' X-Git-Tag: 4.1.0.0~89 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=05818ea4267c3e2a196071d17d8735d6f6fe65c9;p=rocksndiamonds.git removed unused option to set first level of user level sets not to be '1' --- diff --git a/src/editor.c b/src/editor.c index 9677a17c..cef0b287 100644 --- a/src/editor.c +++ b/src/editor.c @@ -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); diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 80d224e5..8662b204 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -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) diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 7e45cb5a..f7b78928 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -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);