fixed a bug where engine version wasn't being passed right
authorDavid Anderson <dvander@alliedmods.net>
Wed Oct 10 02:43:25 2007 +0000 (2007-10-10)
changeset 408a0f99231cf3b
parent 407 af2530a35c5c
child 409 c0a9dcf37cae
fixed a bug where engine version wasn't being passed right
sourcemm/episode1/provider_ep1.cpp
sourcemm/episode1/provider_ep1.h
sourcemm/episode2/provider_ep2.cpp
sourcemm/metamod.cpp
sourcemm/metamod_provider.h
     1.1 --- a/sourcemm/episode1/provider_ep1.cpp	Wed Oct 10 01:42:25 2007 +0000
     1.2 +++ b/sourcemm/episode1/provider_ep1.cpp	Wed Oct 10 02:43:25 2007 +0000
     1.3 @@ -309,6 +309,18 @@
     1.4  	return server->GetGameDescription();
     1.5  }
     1.6  
     1.7 +int BaseProvider::DetermineSourceEngine(const char *game)
     1.8 +{
     1.9 +	if (strcmp(game, "ship") == 0)
    1.10 +	{
    1.11 +		return SOURCE_ENGINE_ORIGINAL;
    1.12 +	}
    1.13 +	else
    1.14 +	{
    1.15 +		return SOURCE_ENGINE_EPISODEONE;
    1.16 +	}
    1.17 +}
    1.18 +
    1.19  ConVar *BaseProvider::CreateConVar(const char *name,
    1.20  								   const char *defval,
    1.21  								   const char *help,
     2.1 --- a/sourcemm/episode1/provider_ep1.h	Wed Oct 10 01:42:25 2007 +0000
     2.2 +++ b/sourcemm/episode1/provider_ep1.h	Wed Oct 10 02:43:25 2007 +0000
     2.3 @@ -70,6 +70,7 @@
     2.4  	virtual int GetUserMessageCount();
     2.5  	virtual int FindUserMessage(const char *name, int *size=NULL);
     2.6  	virtual const char *GetUserMessage(int index, int *size=NULL);
     2.7 +	virtual int DetermineSourceEngine(const char *game);
     2.8  };
     2.9  
    2.10  extern IVEngineServer *engine;
     3.1 --- a/sourcemm/episode2/provider_ep2.cpp	Wed Oct 10 01:42:25 2007 +0000
     3.2 +++ b/sourcemm/episode2/provider_ep2.cpp	Wed Oct 10 02:43:25 2007 +0000
     3.3 @@ -324,6 +324,11 @@
     3.4  	return server->GetGameDescription();
     3.5  }
     3.6  
     3.7 +int BaseProvider::DetermineSourceEngine(const char *game)
     3.8 +{
     3.9 +	return SOURCE_ENGINE_ORANGEBOX;
    3.10 +}
    3.11 +
    3.12  ConVar *BaseProvider::CreateConVar(const char *name,
    3.13  								   const char *defval,
    3.14  								   const char *help,
     4.1 --- a/sourcemm/metamod.cpp	Wed Oct 10 01:42:25 2007 +0000
     4.2 +++ b/sourcemm/metamod.cpp	Wed Oct 10 02:43:25 2007 +0000
     4.3 @@ -239,7 +239,7 @@
     4.4  		/* Get value of -game from command line, defaulting to hl2 as engine seems to do */
     4.5  		game_dir = provider->GetCommandLineValue("-game", "hl2");
     4.6  
     4.7 -		engine_build = SOURCE_ENGINE_ORANGEBOX;
     4.8 +		engine_build = provider->DetermineSourceEngine(game_dir);;
     4.9  
    4.10  		/* Get absolute path */
    4.11  		abspath(game_path, game_dir);
     5.1 --- a/sourcemm/metamod_provider.h	Wed Oct 10 01:42:25 2007 +0000
     5.2 +++ b/sourcemm/metamod_provider.h	Wed Oct 10 02:43:25 2007 +0000
     5.3 @@ -283,6 +283,14 @@
     5.4  		 * @return				Message name, or NULL on failure.
     5.5  		 */
     5.6  		virtual const char *GetUserMessage(int index, int *size=NULL) =0;
     5.7 +
     5.8 +		/**
     5.9 +		 * @brief Returns the Source Engine build.
    5.10 +		 *
    5.11 +		 * @param game			Game folder.
    5.12 +		 * @return				SOURCE_ENGINE constant.
    5.13 +		 */
    5.14 +		virtual int DetermineSourceEngine(const char *game) =0;
    5.15  	};
    5.16  };
    5.17