1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-03-21 12:28:56 +01:00

fixed a bug where engine version wasn't being passed right

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40495
This commit is contained in:
David Anderson 2007-10-10 02:43:25 +00:00
parent 81cea20c97
commit 630070ea00
5 changed files with 27 additions and 1 deletions

View File

@ -309,6 +309,18 @@ const char *BaseProvider::GetGameDescription()
return server->GetGameDescription();
}
int BaseProvider::DetermineSourceEngine(const char *game)
{
if (strcmp(game, "ship") == 0)
{
return SOURCE_ENGINE_ORIGINAL;
}
else
{
return SOURCE_ENGINE_EPISODEONE;
}
}
ConVar *BaseProvider::CreateConVar(const char *name,
const char *defval,
const char *help,

View File

@ -70,6 +70,7 @@ public:
virtual int GetUserMessageCount();
virtual int FindUserMessage(const char *name, int *size=NULL);
virtual const char *GetUserMessage(int index, int *size=NULL);
virtual int DetermineSourceEngine(const char *game);
};
extern IVEngineServer *engine;

View File

@ -324,6 +324,11 @@ const char *BaseProvider::GetGameDescription()
return server->GetGameDescription();
}
int BaseProvider::DetermineSourceEngine(const char *game)
{
return SOURCE_ENGINE_ORANGEBOX;
}
ConVar *BaseProvider::CreateConVar(const char *name,
const char *defval,
const char *help,

View File

@ -239,7 +239,7 @@ SMM_API void *CreateInterface(const char *iface, int *ret)
/* Get value of -game from command line, defaulting to hl2 as engine seems to do */
game_dir = provider->GetCommandLineValue("-game", "hl2");
engine_build = SOURCE_ENGINE_ORANGEBOX;
engine_build = provider->DetermineSourceEngine(game_dir);;
/* Get absolute path */
abspath(game_path, game_dir);

View File

@ -283,6 +283,14 @@ namespace SourceMM
* @return Message name, or NULL on failure.
*/
virtual const char *GetUserMessage(int index, int *size=NULL) =0;
/**
* @brief Returns the Source Engine build.
*
* @param game Game folder.
* @return SOURCE_ENGINE constant.
*/
virtual int DetermineSourceEngine(const char *game) =0;
};
};