]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge pull request #21 from merlin1991/Q3-gamepack-fix
authorTimothee "TTimo" Besset <ttimo@ttimo.net>
Mon, 26 Mar 2012 13:56:22 +0000 (06:56 -0700)
committerTimothee "TTimo" Besset <ttimo@ttimo.net>
Mon, 26 Mar 2012 13:56:22 +0000 (06:56 -0700)
copy shaderlist for Q3 if missing and make sure the config folder for *.game files exists

radiant/preferences.cpp

index 3a43c35a2a04d668982c2f8b354aafd27355f836..430c751fac7136b18ea300825b1817e697102d6f 100644 (file)
@@ -3408,6 +3408,9 @@ void CGameInstall::Run() {
        // write out the game file
        Str gameFilePath = g_strAppPath.GetBuffer();
        gameFilePath += "games/";
+       if(CheckFile(gameFilePath) != PATH_DIRECTORY) {
+               radCreateDirectory(gameFilePath);
+       }
        gameFilePath += m_strName.GetBuffer();
        gameFilePath += ".game";
        Sys_Printf( "game file: %s\n", gameFilePath.GetBuffer() );
@@ -3441,6 +3444,12 @@ void CGameInstall::Run() {
                source += "/install/";
                Str dest = m_strEngine.GetBuffer();
                CopyTree( source.GetBuffer(), dest.GetBuffer() );
+               // Hardcoded fix for "missing" shaderlist in gamepack
+               dest += "/baseq3/scripts/shaderlist.txt";
+               if(CheckFile(dest.GetBuffer()) != PATH_FILE) {
+                       source += "baseq3/scripts/default_shaderlist.txt";
+                       radCopyFile(source.GetBuffer(),dest.GetBuffer());
+               }
                fprintf( fg, "  basegame=\"baseq3\"\n" );
                break;
        }