sourcemm/sourcemm.cpp
branchsourcemm-1.6.0
changeset 351 7347be0355ae
parent 348 716af2e7be78
     1.1 --- a/sourcemm/sourcemm.cpp	Fri Sep 21 16:54:52 2007 +0000
     1.2 +++ b/sourcemm/sourcemm.cpp	Fri Sep 21 18:03:57 2007 +0000
     1.3 @@ -60,6 +60,7 @@
     1.4  int g_GameDllVersion = 0;
     1.5  int g_GameClientsVersion = 0;
     1.6  int g_VspVersion = 0;
     1.7 +int g_SourceEngineVersion = SOURCE_ENGINE_ORIGINAL;
     1.8  const char VSPIFACE[] = "ISERVERPLUGINCALLBACKS";
     1.9  const char GAMEINFO_PATH[] = "|gameinfo_path|";
    1.10  
    1.11 @@ -218,7 +219,7 @@
    1.12  	/* Prevent loading of self as a SourceMM plugin or Valve server plugin :x */
    1.13  	if (strcmp(iface, PLAPI_NAME) == 0)
    1.14  	{
    1.15 -		Warning("Do not try loading Metamod:Source as a SourceMM or Valve server plugin.\n");
    1.16 +		Warning("Do not try loading Metamod:Source as a plugin.\n");
    1.17  
    1.18  		if (ret)
    1.19  		{
    1.20 @@ -388,16 +389,18 @@
    1.21  		{
    1.22  			/* This is the interface we want!  Right now we support versions 3 through 8 */
    1.23  			g_GameDllVersion = atoi(&(iface[len]));
    1.24 -			int sizeTooBig = 0;	//rename this to sizeWrong in the future!
    1.25 -			if (g_GameDllVersion < MIN_GAMEDLL_VERSION || g_GameDllVersion > MAX_GAMEDLL_VERSION)
    1.26 +			if (g_GameDllVersion < MIN_GAMEDLL_VERSION)
    1.27  			{
    1.28 -				/* Maybe this will get used in the future */
    1.29 -				sizeTooBig = g_GameDllVersion;
    1.30  				if (ret)
    1.31  				{
    1.32  					*ret = IFACE_FAILED;
    1.33  				}
    1.34  			}
    1.35 +			else if (g_GameDllVersion > 3)
    1.36 +			{
    1.37 +				/* The engine is at least episode 1 */
    1.38 +				g_SourceEngineVersion = SOURCE_ENGINE_EPISODEONE;
    1.39 +			}
    1.40  			SourceHook::List<GameDllInfo *>::iterator iter;
    1.41  			GameDllInfo *pInfo = NULL;
    1.42  			void *ptr;
    1.43 @@ -418,21 +421,12 @@
    1.44  			}
    1.45  			if (g_GameDll.loaded)
    1.46  			{
    1.47 -				if (sizeTooBig)
    1.48 +				InitMainStates();
    1.49 +			} else {
    1.50 +				if (ret)
    1.51  				{
    1.52 -					Error("This mod version requires a SourceMM update (ServerGameDLL%03d)!\n", sizeTooBig);
    1.53 -					if (ret)
    1.54 -					{
    1.55 -						*ret = IFACE_FAILED;
    1.56 -					}
    1.57 -					return NULL;
    1.58 -				} else {
    1.59 -					InitMainStates();
    1.60 +					*ret = IFACE_FAILED;
    1.61  				}
    1.62 -			} else {
    1.63 -				sizeTooBig = 0;
    1.64 -				if (ret)
    1.65 -					*ret = IFACE_FAILED;
    1.66  				return NULL;
    1.67  			}
    1.68  		} else {