diff -r 9ab1ac4cc4e4 -r 7347be0355ae sourcemm/sourcemm.cpp --- a/sourcemm/sourcemm.cpp Fri Sep 21 16:54:52 2007 +0000 +++ b/sourcemm/sourcemm.cpp Fri Sep 21 18:03:57 2007 +0000 @@ -60,6 +60,7 @@ int g_GameDllVersion = 0; int g_GameClientsVersion = 0; int g_VspVersion = 0; +int g_SourceEngineVersion = SOURCE_ENGINE_ORIGINAL; const char VSPIFACE[] = "ISERVERPLUGINCALLBACKS"; const char GAMEINFO_PATH[] = "|gameinfo_path|"; @@ -218,7 +219,7 @@ /* Prevent loading of self as a SourceMM plugin or Valve server plugin :x */ if (strcmp(iface, PLAPI_NAME) == 0) { - Warning("Do not try loading Metamod:Source as a SourceMM or Valve server plugin.\n"); + Warning("Do not try loading Metamod:Source as a plugin.\n"); if (ret) { @@ -388,16 +389,18 @@ { /* This is the interface we want! Right now we support versions 3 through 8 */ g_GameDllVersion = atoi(&(iface[len])); - int sizeTooBig = 0; //rename this to sizeWrong in the future! - if (g_GameDllVersion < MIN_GAMEDLL_VERSION || g_GameDllVersion > MAX_GAMEDLL_VERSION) + if (g_GameDllVersion < MIN_GAMEDLL_VERSION) { - /* Maybe this will get used in the future */ - sizeTooBig = g_GameDllVersion; if (ret) { *ret = IFACE_FAILED; } } + else if (g_GameDllVersion > 3) + { + /* The engine is at least episode 1 */ + g_SourceEngineVersion = SOURCE_ENGINE_EPISODEONE; + } SourceHook::List::iterator iter; GameDllInfo *pInfo = NULL; void *ptr; @@ -418,21 +421,12 @@ } if (g_GameDll.loaded) { - if (sizeTooBig) + InitMainStates(); + } else { + if (ret) { - Error("This mod version requires a SourceMM update (ServerGameDLL%03d)!\n", sizeTooBig); - if (ret) - { - *ret = IFACE_FAILED; - } - return NULL; - } else { - InitMainStates(); + *ret = IFACE_FAILED; } - } else { - sizeTooBig = 0; - if (ret) - *ret = IFACE_FAILED; return NULL; } } else {