core/metamod.cpp
changeset 637 b66489d8aedc
parent 635 61c2224c8d68
child 639 5b691c4b0849
     1.1 --- a/core/metamod.cpp	Mon Feb 16 18:13:31 2009 -0500
     1.2 +++ b/core/metamod.cpp	Wed Feb 18 01:38:23 2009 -0600
     1.3 @@ -194,13 +194,22 @@
     1.4  	metamod_path.assign(mm_path);
     1.5  
     1.6  	/* Get value of -game from command line, defaulting to hl2 as engine seems to do */
     1.7 -	const char *game_dir = provider->GetCommandLineValue("-game", "hl2");
     1.8 +	const char *game_dir = provider->GetCommandLineValue("-game");
     1.9  
    1.10 -	/* Get absolute path */
    1.11 -	abspath(game_path, game_dir);
    1.12 +	if (game_dir)
    1.13 +	{
    1.14 +		/* Get absolute path */
    1.15 +		abspath(game_path, game_dir);
    1.16 +	}
    1.17 +	else
    1.18 +	{
    1.19 +		/* Get absolute path for current directory */
    1.20 +		abspath(game_path, ".");
    1.21 +	}
    1.22 +
    1.23  	mod_path.assign(game_path);
    1.24  
    1.25 -	engine_build = provider->DetermineSourceEngine(game_dir);;
    1.26 +	engine_build = provider->DetermineSourceEngine(game_dir);
    1.27  
    1.28  	return true;
    1.29  }