gameshim/stripper_mm.cpp
changeset 20 443c594aaef8
parent 19 6164205b828d
child 25 ba37f00bef65
     1.1 --- a/gameshim/stripper_mm.cpp	Mon May 11 23:01:38 2009 +0000
     1.2 +++ b/gameshim/stripper_mm.cpp	Tue May 12 14:13:01 2009 +0000
     1.3 @@ -9,6 +9,12 @@
     1.4   * ===================================
     1.5   */
     1.6  
     1.7 +#include <stdio.h>
     1.8 +#ifdef WIN32
     1.9 +#include <windows.h>
    1.10 +#define snprintf _snprintf
    1.11 +#define vsnprintf _vsnprintf
    1.12 +#endif
    1.13  #include "stripper_mm.h"
    1.14  #include "intercom.h"
    1.15  #include "icommandline.h"
    1.16 @@ -130,7 +136,12 @@
    1.17      stripper_game.game_path = game_path;
    1.18      stripper_game.stripper_path = "addons/stripper";
    1.19  
    1.20 +#if SOURCE_ENGINE==SE_DARKMESSIAH
    1.21 +	ICvar* cvar = GetICVar();
    1.22 +	const char* temp = (cvar == NULL) ? NULL : cvar->GetCommandLineValue("+stripper_path");
    1.23 +#else
    1.24      const char* temp = CommandLine()->ParmValue("+stripper_path");
    1.25 +#endif
    1.26      if (temp != NULL && temp[0] != '\0')
    1.27      {
    1.28          g_SMAPI->PathFormat(stripper_path, sizeof(stripper_path), "%s", temp);
    1.29 @@ -164,8 +175,8 @@
    1.30                  NULL,
    1.31                  dw,
    1.32                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    1.33 -                buffer,
    1.34 -                maxlength,
    1.35 +                error,
    1.36 +                maxlen,
    1.37                  NULL) == 0)
    1.38          {
    1.39              _snprintf(error, maxlen, "Unknown error: %d", dw);