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:
parent
81cea20c97
commit
630070ea00
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user