gameshim/stripper_mm.cpp
changeset 48 368cec2fcccf
parent 47 4c414b740a9c
child 50 283c61b92615
     1.1 --- a/gameshim/stripper_mm.cpp	Sun Jun 26 00:42:31 2011 -0700
     1.2 +++ b/gameshim/stripper_mm.cpp	Thu May 19 13:09:36 2011 -0500
     1.3 @@ -33,6 +33,7 @@
     1.4  static stripper_core_t stripper_core;
     1.5  static char game_path[256];
     1.6  static char stripper_path[256];
     1.7 +static char stripper_cfg_path[256];
     1.8  
     1.9  SH_DECL_HOOK0(IVEngineServer, GetMapEntitiesString, SH_NOATTRIB, 0, const char *);
    1.10  SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, 0, bool, char const *, char const *, char const *, char const *, bool, bool);
    1.11 @@ -114,11 +115,24 @@
    1.12  {
    1.13      NULL,
    1.14      NULL,
    1.15 +    NULL,
    1.16      log_message,
    1.17      path_format,
    1.18      get_map_name,
    1.19  };
    1.20  
    1.21 +ConVar cvar_stripper_cfg_path("stripper_cfg_path", "addons/stripper", FCVAR_NONE, "Stripper Config Path");
    1.22 +
    1.23 +#if SOURCE_ENGINE >= SE_ORANGEBOX
    1.24 +void stripper_cfg_path_changed(IConVar *var, const char *pOldValue, float flOldValue)
    1.25 +#else
    1.26 +void stripper_cfg_path_changed(ConVar *var, const char *pOldValue)
    1.27 +#endif
    1.28 +{
    1.29 +    strncpy(stripper_cfg_path, cvar_stripper_cfg_path.GetString(), sizeof(stripper_cfg_path));
    1.30 +}
    1.31 +
    1.32 +
    1.33  bool
    1.34  StripperPlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
    1.35  {
    1.36 @@ -137,6 +151,10 @@
    1.37      engine->GetGameDir(game_path, sizeof(game_path));
    1.38      stripper_game.game_path = game_path;
    1.39      stripper_game.stripper_path = "addons/stripper";
    1.40 +    stripper_game.stripper_cfg_path = stripper_cfg_path;
    1.41 +    strncpy(stripper_cfg_path, cvar_stripper_cfg_path.GetString(), sizeof(stripper_cfg_path));
    1.42 +
    1.43 +    cvar_stripper_cfg_path.InstallChangeCallback( stripper_cfg_path_changed );
    1.44  
    1.45  #if SOURCE_ENGINE==SE_DARKMESSIAH
    1.46  	ICvar* cvar = GetICVar();