From 6a647bd3b50660393f584ae529fcebef8a94540e Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Wed, 10 Jun 2020 13:33:21 +0000 Subject: [PATCH] Code style improvements Partially from https://gitlab.com/xonotic/darkplaces/-/merge_requests/85 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12664 d7cf8633-e32d-0410-b094-e92efae38249 --- fs.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/fs.c b/fs.c index f4f1e55f..c74eab8c 100644 --- a/fs.c +++ b/fs.c @@ -1797,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); } } -- 2.39.2