fix a bug in FS_ChangeGameDirs (it was doing a CL_Disconnect - can't do
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 28 Feb 2008 10:35:29 +0000 (10:35 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 28 Feb 2008 10:35:29 +0000 (10:35 +0000)
that because when connecting to a QW server it disconnects)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8157 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index dc75fdc..3e3820e 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1243,9 +1243,6 @@ qboolean FS_ChangeGameDirs(int numgamedirs, char gamedirs[][MAX_QPATH], qboolean
                }
        }
 
-       // halt demo playback to close the file
-       CL_Disconnect();
-
        Host_SaveConfig();
 
        fs_numgamedirs = numgamedirs;
@@ -1304,6 +1301,9 @@ void FS_GameDir_f (void)
                return;
        }
 
+       // halt demo playback to close the file
+       CL_Disconnect();
+
        FS_ChangeGameDirs(numgamedirs, gamedirs, true, true);
 }
 
@@ -2628,7 +2628,7 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet)
                                if( !nextseparator ) {
                                        nextseparator = start + strlen( start );
                                }
-                               
+
                                // prevseparator points past the '/' right before the wildcard and nextseparator at the one following it (or at the end of the string)
                                // copy everything up except nextseperator
                                strlcpy(subpattern, pattern, min(sizeof(subpattern), (size_t) (nextseparator - pattern + 1)));
@@ -2641,12 +2641,12 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet)
                                // copy everything from start to the previous including the '/' (before the wildcard)
                                // everything up to start is already included in the path of matchedSet's entries
                                strlcpy(subpath, start, min(sizeof(subpath), (size_t) ((prevseparator - subpattern) - (start - pattern) + 1)));
-                               
+
                                // for each entry in matchedSet try to open the subdirectories specified in subpath
                                for( dirlistindex = 0 ; dirlistindex < matchedSet.numstrings ; dirlistindex++ ) {
                                        strlcpy( temp, matchedSet.strings[ dirlistindex ], sizeof(temp) );
                                        strlcat( temp, subpath, sizeof(temp) );
-                                       listdirectory( &foundSet, searchpath->filename, temp );                         
+                                       listdirectory( &foundSet, searchpath->filename, temp );
                                }
                                if( dirlistindex == 0 ) {
                                        break;
@@ -2664,7 +2664,7 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet)
 
                                start = nextseparator;
                        }
-                       
+
                        for (dirlistindex = 0;dirlistindex < matchedSet.numstrings;dirlistindex++)
                        {
                                const char *temp = matchedSet.strings[dirlistindex];