]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/environment.cpp
Merge branch 'NateEag-master-patch-12920' into 'master'
[xonotic/netradiant.git] / radiant / environment.cpp
index ab3dc398cd889bfb883be1cf7c247166cf5f0d2d..1e02a14153336f81fdb408ae11cc2b4d51b25b85 100644 (file)
@@ -110,7 +110,8 @@ bool gamedetect_check_game( char const *gamefile, const char *checkfile1, const
 void gamedetect(){
        // if we're inside a Nexuiz install
        // default to nexuiz.game (unless the user used an option to inhibit this)
-       bool nogamedetect = false;
+       //bool nogamedetect = false;
+       bool nogamedetect = true;
        int i;
        for ( i = 1; i < g_argc - 1; ++i )
        {
@@ -208,6 +209,20 @@ bool portable_app_setup(){
        return false;
 }
 
+
+const char* openCmdMap;
+
+void cmdMap(){
+       openCmdMap = NULL;
+       for ( int i = 1; i < g_argc; ++i )
+       {
+               //if ( !stricmp( g_argv[i] + strlen(g_argv[i]) - 4, ".map" ) ){
+               if( string_equal_suffix_nocase( g_argv[i], ".map" ) ){
+                       openCmdMap = g_argv[i];
+               }
+       }
+}
+
 #if GDEF_OS_POSIX
 
 #include <stdlib.h>
@@ -336,6 +351,7 @@ void environment_init( int argc, char const* argv[] ){
        }
 
        gamedetect();
+       cmdMap();
 }
 
 #elif GDEF_OS_WINDOWS
@@ -374,13 +390,18 @@ void environment_init( int argc, char const* argv[] ){
 
        if ( !portable_app_setup() ) {
                char *appdata = getenv( "APPDATA" );
+
                StringOutputStream home( 256 );
                home << PathCleaned( appdata );
-               home << "/NetRadiantSettings/";
+               home << "/";
+               home << RADIANT_NAME;
+               home << "/";
+
                Q_mkdir( home.c_str() );
                home_path = home.c_str();
        }
        gamedetect();
+       cmdMap();
 }
 
 #else