From cfa099c0c7229194a1d97e91aea67296ee66aca3 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 17 Dec 2004 14:31:18 +0000 Subject: [PATCH] allocate mission filenames dynamically --- main/mission.c | 4 +++- main/mission.h | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/main/mission.c b/main/mission.c index 1667385f..229095fe 100644 --- a/main/mission.c +++ b/main/mission.c @@ -1,4 +1,4 @@ -/* $Id: mission.c,v 1.37 2004-12-17 14:28:41 btb Exp $ */ +/* $Id: mission.c,v 1.38 2004-12-17 14:31:18 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -455,6 +455,7 @@ void add_missions_to_list(mle *mission, int anarchy_mode) ext = strrchr(*i, '.'); if (ext && (!strnicmp(ext, ".msn", 4) || !strnicmp(ext, ".mn2", 4))) if (read_mission_file(mission, *i, ML_MISSIONDIR)) + { if (anarchy_mode || !mission->anarchy_only_flag) { mission++; num_missions++; @@ -462,6 +463,7 @@ void add_missions_to_list(mle *mission, int anarchy_mode) } else d_free(mission->filename); + } if (num_missions >= MAX_MISSIONS) { mprintf((0, "Warning: more missions than d2x can handle\n")); diff --git a/main/mission.h b/main/mission.h index b6253aa4..cab5ca52 100644 --- a/main/mission.h +++ b/main/mission.h @@ -1,4 +1,4 @@ -/* $Id: mission.h,v 1.23 2004-11-19 18:42:48 schaffner Exp $ */ +/* $Id: mission.h,v 1.24 2004-12-17 14:28:41 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -63,12 +63,12 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif typedef struct { + char *filename; // filename + int builtin_hogsize; // the size of the hogfile for a builtin mission, and 0 for an add-on mission char mission_name[MISSION_NAME_LEN+1]; - char filename[9]; // filename ubyte descent_version; // descent 1 or descent 2? - bool anarchy_only_flag; // if true, mission is only for anarchy + ubyte anarchy_only_flag; // if true, mission is only for anarchy ubyte enhanced; // 0: mission has "name", 1:"xname", 2:"zname" - int builtin_hogsize; // the size of the hogfile for a builtin mission, and 0 for an add-on mission char briefing_text_filename[FILENAME_LEN]; // name of briefing file char ending_text_filename[FILENAME_LEN]; // name of ending file ubyte last_level; -- 2.39.2