]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/qe3.cpp
radiant: add optional pakpath support
[xonotic/netradiant.git] / radiant / qe3.cpp
index 7d39afe628a1c55d7d59d48f7e9f46bc55cd6cbf..5360a0ab28368b41b0661d2b303c2198a053c148 100644 (file)
@@ -113,6 +113,13 @@ void QE_InitVFS(){
                globalBasePath << globalRoot << basegame << '/';
                GlobalFileSystem().initDirectory( globalBasePath.c_str() );
        }
+
+       // extra pakpaths
+       for ( int i = 0; i < g_pakPathCount; i++ ) {
+               if (g_strcmp0( g_strPakPath[i].c_str(), "")) {
+                       GlobalFileSystem().initDirectory( g_strPakPath[i].c_str() );
+               }
+       }
 }
 
 int g_numbrushes = 0;
@@ -167,6 +174,17 @@ void bsp_init(){
        build_set_variable( "MonitorAddress", ( g_WatchBSP_Enabled ) ? "127.0.0.1:39000" : "" );
        build_set_variable( "GameName", gamename_get() );
 
+       StringBuffer ExtraQ3map2Args;
+       // extra pakpaths
+       for ( int i = 0; i < g_pakPathCount; i++ ) {
+               if ( g_strcmp0( g_strPakPath[i].c_str(), "") ) {
+                       ExtraQ3map2Args.push_string( " -fs_pakpath \"" );
+                       ExtraQ3map2Args.push_string( g_strPakPath[i].c_str() );
+                       ExtraQ3map2Args.push_string( "\"" );
+               }
+       }
+       build_set_variable( "ExtraQ3map2Args", ExtraQ3map2Args.c_str() );
+
        const char* mapname = Map_Name( g_map );
        StringOutputStream name( 256 );
        name << StringRange( mapname, path_get_filename_base_end( mapname ) ) << ".bsp";