sourcemm/sourcemm.cpp
changeset 263 13c2809e96b8
parent 238 c27105949293
child 278 614ea295cd25
     1.1 --- a/sourcemm/sourcemm.cpp	Thu Oct 05 06:11:53 2006 +0000
     1.2 +++ b/sourcemm/sourcemm.cpp	Wed Oct 25 20:35:29 2006 +0000
     1.3 @@ -280,8 +280,20 @@
     1.4  		FILE *fp = fopen(temp_path, "rt");
     1.5  		if (!fp)
     1.6  		{
     1.7 -			Error("Unable to open gameinfo.txt!  Metamod cannot load.\n");
     1.8 -			return NULL;
     1.9 +			/* Do not error out here! It's possible the mod exists in the root directory, i.e.
    1.10 +			 * Dark Messiah.  Let's check that just in case!
    1.11 +			 */
    1.12 +			g_SmmAPI.PathFormat(temp_path, sizeof(temp_path)-1, "%s", curpath);
    1.13 +			g_ModPath.assign(temp_path);
    1.14 +			g_SmmAPI.PathFormat(temp_path, sizeof(temp_path)-1, "%s/%s", g_ModPath.c_str(), "gameinfo.txt");
    1.15 +
    1.16 +			fp = fopen(temp_path, "rt");
    1.17 +			if (!fp)
    1.18 +			{
    1.19 +				/* Okay, we have to concede here. */
    1.20 +				Error("Unable to open gameinfo.txt!  Metamod cannot load.\n");
    1.21 +				return NULL;
    1.22 +			}
    1.23  		}
    1.24  		char buffer[255];
    1.25  		char key[128], val[128];