]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - fs.c
Code style improvements
[xonotic/darkplaces.git] / fs.c
diff --git a/fs.c b/fs.c
index 590a336c6d91be736bcc3b486977fcea876c9334..c74eab8cc40a1015d57729ceaa8f7c560349a38a 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1581,10 +1581,6 @@ qboolean FS_ChangeGameDirs(int numgamedirs, char gamedirs[][MAX_QPATH], qboolean
        // unload all sounds so they will be reloaded from the new files as needed
        S_UnloadAllSounds_f(&cmd_client);
 
-       // close down the video subsystem, it will start up again when the config finishes...
-       VID_Stop();
-       vid_opened = false;
-
        // restart the video subsystem after the config is executed
        Cbuf_InsertText(&cmd_client, "\nloadconfig\nvid_restart\n\n");
 
@@ -1801,33 +1797,36 @@ FS_Init_SelfPack
 */
 void FS_Init_SelfPack (void)
 {
+       char *buf;
+
        PK3_OpenLibrary ();
        fs_mempool = Mem_AllocPool("file management", 0, NULL);
 
        // Load darkplaces.opt from the FS.
        if (!COM_CheckParm("-noopt"))
        {
-               char *buf = (char *) FS_SysLoadFile("darkplaces.opt", tempmempool, true, NULL);
+               buf = (char *) FS_SysLoadFile("darkplaces.opt", tempmempool, true, NULL);
                if(buf)
+               {
                        COM_InsertFlags(buf);
-               Mem_Free(buf);
+                       Mem_Free(buf);
+               }
        }
 
 #ifndef USE_RWOPS
        // Provide the SelfPack.
-       if (!COM_CheckParm("-noselfpack"))
+       if (!COM_CheckParm("-noselfpack") && com_selffd >= 0)
        {
-               if (com_selffd >= 0)
+               fs_selfpack = FS_LoadPackPK3FromFD(com_argv[0], com_selffd, true);
+               if(fs_selfpack)
                {
-                       fs_selfpack = FS_LoadPackPK3FromFD(com_argv[0], com_selffd, true);
-                       if(fs_selfpack)
+                       FS_AddSelfPack();
+                       if (!COM_CheckParm("-noopt"))
                        {
-                               FS_AddSelfPack();
-                               if (!COM_CheckParm("-noopt"))
+                               buf = (char *) FS_LoadFile("darkplaces.opt", tempmempool, true, NULL);
+                               if(buf)
                                {
-                                       char *buf = (char *) FS_LoadFile("darkplaces.opt", tempmempool, true, NULL);
-                                       if(buf)
-                                               COM_InsertFlags(buf);
+                                       COM_InsertFlags(buf);
                                        Mem_Free(buf);
                                }
                        }