@@ -1551,7 +1551,7 @@ int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* fil
15511551 }
15521552
15531553 bool skip_packfiles = false ;
1554- if ( (pathtype == CF_TYPE_PLAYERS) || (pathtype == CF_TYPE_SINGLE_PLAYERS) || (pathtype == CF_TYPE_MULTI_PLAYERS) ) {
1554+ if ( (pathtype == CF_TYPE_SINGLE_PLAYERS) || (pathtype == CF_TYPE_MULTI_PLAYERS) ) {
15551555 skip_packfiles = true ;
15561556 } else if (Get_file_list_child != NULL ) {
15571557 skip_packfiles = true ;
@@ -1708,7 +1708,7 @@ int cf_get_file_list(int max, char** list, int pathtype, const char* filter, int
17081708 }
17091709
17101710 bool skip_packfiles = false ;
1711- if ((pathtype == CF_TYPE_PLAYERS) || (pathtype == CF_TYPE_SINGLE_PLAYERS) || (pathtype == CF_TYPE_MULTI_PLAYERS)) {
1711+ if ((pathtype == CF_TYPE_SINGLE_PLAYERS) || (pathtype == CF_TYPE_MULTI_PLAYERS)) {
17121712 skip_packfiles = true ;
17131713 }
17141714 else if (Get_file_list_child != NULL ) {
@@ -1887,7 +1887,7 @@ int cf_get_file_list_preallocated(int max, char arr[][MAX_FILENAME_LEN], char**
18871887 }
18881888
18891889 bool skip_packfiles = false ;
1890- if ((pathtype == CF_TYPE_PLAYERS) || (pathtype == CF_TYPE_SINGLE_PLAYERS) || (pathtype == CF_TYPE_MULTI_PLAYERS)) {
1890+ if ((pathtype == CF_TYPE_SINGLE_PLAYERS) || (pathtype == CF_TYPE_MULTI_PLAYERS)) {
18911891 skip_packfiles = true ;
18921892 }
18931893 else if (Get_file_list_child != NULL ) {
@@ -1981,15 +1981,27 @@ int cf_get_file_list_preallocated(int max, char arr[][MAX_FILENAME_LEN], char**
19811981// Output: path - Fully qualified pathname.
19821982// Returns 0 if the result would be too long (invalid result)
19831983int cf_create_default_path_string (char * path, uint path_max, int pathtype, const char * filename, bool localize,
1984- uint32_t location_flags )
1984+ uint32_t _location_flags )
19851985{
1986+ uint32_t location_flags = _location_flags;
1987+
19861988 if ( filename && strchr (filename, DIR_SEPARATOR_CHAR) ) {
19871989 // Already has full path
19881990 strncpy ( path, filename, path_max );
19891991
19901992 } else {
19911993 cf_root* root = nullptr ;
19921994
1995+ // override location flags for path types which should always come from the root (NOT mod directories)
1996+ // NOTE: cache directories should NOT be added here to avoid possible mod breakage
1997+ switch (pathtype) {
1998+ case CF_TYPE_PLAYERS:
1999+ case CF_TYPE_MULTI_PLAYERS:
2000+ case CF_TYPE_SINGLE_PLAYERS:
2001+ location_flags = CF_LOCATION_ROOT_USER | CF_LOCATION_ROOT_GAME | CF_LOCATION_TYPE_ROOT;
2002+ break ;
2003+ }
2004+
19932005 for (auto i = 0 ; i < Num_roots; ++i) {
19942006 auto current_root = cf_get_root (i);
19952007
0 commit comments