From fe8e56ad76a92eeea1503b9ff414459ce95f2f45 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Tue, 29 Jan 2002 10:11:31 +0000 Subject: [PATCH] allow missions to be in AltHogDir --- main/mission.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/main/mission.c b/main/mission.c index 536851c3..e2047292 100644 --- a/main/mission.c +++ b/main/mission.c @@ -16,13 +16,14 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: mission.c,v 1.2 2001-01-31 15:17:54 bradleyb Exp $"; +static char rcsid[] = "$Id: mission.c,v 1.3 2002-01-29 10:11:31 bradleyb Exp $"; #endif #include #include #include #include +#include #include "pstypes.h" #include "cfile.h" @@ -336,13 +337,15 @@ int read_mission_file(char *filename,int count,int location) //if there is only one mission, this function will call load_mission on it. extern char CDROM_dir[]; +extern char AltHogDir[]; +extern char AltHogdir_initialized; int build_mission_list(int anarchy_mode) { static int num_missions=-1; int count=0,special_count=0; FILEFINDSTRUCT find; - char search_name[100] = MISSION_DIR "*.mn2"; + char search_name[PATH_MAX + 5] = MISSION_DIR "*.mn2"; //now search for levels on disk @@ -378,6 +381,25 @@ int build_mission_list(int anarchy_mode) FileFindClose(); } + if (AltHogdir_initialized) { + strcpy(search_name, AltHogDir); + strcat(search_name, "/" MISSION_DIR "*.mn2"); + if( !FileFindFirst( search_name, &find ) ) { + do { + if (stricmp(find.name,BUILTIN_MISSION)==0) + continue; //skip the built-in + + if (read_mission_file(find.name,count,ML_MISSIONDIR)) { + + if (anarchy_mode || !Mission_list[count].anarchy_only_flag) + count++; + } + + } while( !FileFindNext( &find ) && count