Split TF2, DoD:S, HL2:DM, and ND to separate binaries (bug 5813, r=asherkin).
authorNicholas Hastings <skamonkey@gmail.com>
Sun Jul 21 11:53:56 2013 -0400 (2013-07-21)
changeset 39610dc477c29792
parent 3960 d50b36dc6821
child 3962 ba85947783be
Split TF2, DoD:S, HL2:DM, and ND to separate binaries (bug 5813, r=asherkin).
AMBuildScript
core/HalfLife2.cpp
core/MenuStyle_Base.cpp
core/PlayerManager.cpp
core/convar_sm_l4d.h
core/logic/ExtensionSys.cpp
core/logic/GameConfigs.cpp
core/logic/GameConfigs.h
core/logic_bridge.cpp
core/smn_console.cpp
core/smn_entities.cpp
core/smn_halflife.cpp
extensions/sdkhooks/extension.cpp
extensions/sdkhooks/extension.h
extensions/sdkhooks/takedamageinfohack.cpp
extensions/sdktools/gamerulesnatives.cpp
extensions/sdktools/vcaller.cpp
extensions/sdktools/vnatives.cpp
extensions/sdktools/vsound.cpp
extensions/sdktools/vsound.h
extensions/tf2/AMBuilder
loader/loader.cpp
plugins/basechat.sp
plugins/funcommands.sp
plugins/funcommands/ice.sp
plugins/include/halflife.inc
plugins/playercommands.sp
plugins/playercommands/rename.sp
plugins/reservedslots.sp
plugins/testsuite/cstrike-test.sp
public/sm_platform.h
tools/buildbot/PackageScript
     1.1 --- a/AMBuildScript	Mon Jul 29 10:03:18 2013 -0400
     1.2 +++ b/AMBuildScript	Sun Jul 21 11:53:56 2013 -0400
     1.3 @@ -38,37 +38,46 @@
     1.4  		self.possibleSdks['ep2'] =   {'sdk': 'HL2SDKOB',        'ext': '2.ep2',   'def': '3',
     1.5  		                         'name': 'ORANGEBOX',      'platform': ['windows', 'linux'],
     1.6  		                         'dir': 'hl2sdk-ob'}
     1.7 -		self.possibleSdks['css'] =  {'sdk': 'HL2SDKCSS',   'ext': '2.css',  'def': '6',
     1.8 +		self.possibleSdks['css'] =   {'sdk': 'HL2SDKCSS',       'ext': '2.css',   'def': '6',
     1.9  		                         'name': 'CSS',            'platform': ['windows', 'linux', 'darwin'],
    1.10  		                         'dir': 'hl2sdk-css'}
    1.11 -		self.possibleSdks['ep2v'] =  {'sdk': 'HL2SDKOBVALVE',   'ext': '2.ep2v',  'def': '7',
    1.12 -		                         'name': 'ORANGEBOXVALVE', 'platform': ['windows', 'linux', 'darwin'],
    1.13 -		                        'dir': 'hl2sdk-ob-valve'}
    1.14 -		self.possibleSdks['l4d'] =   {'sdk': 'HL2SDKL4D',       'ext': '2.l4d',   'def': '8',
    1.15 +		self.possibleSdks['hl2dm'] = {'sdk': 'HL2SDKHL2DM',     'ext': '2.hl2dm', 'def': '7',
    1.16 +		                         'name': 'HL2DM',          'platform': ['windows', 'linux', 'darwin'],
    1.17 +		                        'dir': 'hl2sdk-hl2dm'}
    1.18 +		self.possibleSdks['dods'] =  {'sdk': 'HL2SDKDODS',      'ext': '2.dods',  'def': '8',
    1.19 +		                         'name': 'DODS',           'platform': ['windows', 'linux', 'darwin'],
    1.20 +		                        'dir': 'hl2sdk-dods'}
    1.21 +		self.possibleSdks['tf2'] =   {'sdk': 'HL2SDKTF2',       'ext': '2.tf2',   'def': '9',
    1.22 +		                         'name': 'TF2',            'platform': ['windows', 'linux', 'darwin'],
    1.23 +		                        'dir': 'hl2sdk-tf2'}
    1.24 +		self.possibleSdks['l4d'] =   {'sdk': 'HL2SDKL4D',       'ext': '2.l4d',   'def': '10',
    1.25  		                         'name': 'LEFT4DEAD',      'platform': ['windows', 'linux', 'darwin'],
    1.26  		                         'dir': 'hl2sdk-l4d'}
    1.27 -		self.possibleSdks['l4d2'] =  {'sdk': 'HL2SDKL4D2',      'ext': '2.l4d2',  'def': '9',
    1.28 +		self.possibleSdks['nd'] =    {'sdk': 'HL2SDKND',        'ext': '2.nd',    'def': '11',
    1.29 +		                         'name': 'NUCLEARDAWN',    'platform': ['windows', 'linux', 'darwin'],
    1.30 +		                         'dir': 'hl2sdk-nd'}
    1.31 +		self.possibleSdks['l4d2'] =  {'sdk': 'HL2SDKL4D2',      'ext': '2.l4d2',  'def': '12',
    1.32  		                         'name': 'LEFT4DEAD2',     'platform': ['windows', 'linux', 'darwin'],
    1.33  		                         'dir': 'hl2sdk-l4d2'}
    1.34  		self.possibleSdks['darkm'] = {'sdk': 'HL2SDK-DARKM',    'ext': '2.darkm', 'def': '2',
    1.35  		                         'name': 'DARKMESSIAH',    'platform': ['windows'],
    1.36  		                          'dir': 'hl2sdk-darkm'}
    1.37 -		self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM',    'ext': '2.swarm', 'def': '10',
    1.38 +		self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM',    'ext': '2.swarm', 'def': '13',
    1.39  		                         'name': 'ALIENSWARM',     'platform': ['windows'],
    1.40  		                         'dir': 'hl2sdk-swarm'}
    1.41 -		self.possibleSdks['bgt'] =   {'sdk': 'HL2SDK-BGT',      'ext': '2.bgt', 'def': '4',
    1.42 +		self.possibleSdks['bgt'] =   {'sdk': 'HL2SDK-BGT',      'ext': '2.bgt',   'def': '4',
    1.43  		                         'name': 'BLOODYGOODTIME', 'platform': ['windows'],
    1.44  		                         'dir': 'hl2sdk-bgt'}
    1.45 -		self.possibleSdks['eye'] =   {'sdk': 'HL2SDK-EYE',      'ext': '2.eye', 'def': '5',
    1.46 -		                         'name': 'EYE',             'platform': ['windows'],
    1.47 +		self.possibleSdks['eye'] =   {'sdk': 'HL2SDK-EYE',      'ext': '2.eye',   'def': '5',
    1.48 +		                         'name': 'EYE',            'platform': ['windows'],
    1.49  		                         'dir': 'hl2sdk-eye'}
    1.50 -		self.possibleSdks['csgo'] =  {'sdk': 'HL2SDKCSGO',     'ext': '2.csgo',  'def': '12',
    1.51 +		self.possibleSdks['csgo'] =  {'sdk': 'HL2SDKCSGO',     'ext': '2.csgo',   'def': '15',
    1.52  		                         'name': 'CSGO',           'platform': ['windows', 'linux', 'darwin'],
    1.53  		                         'dir': 'hl2sdk-csgo'}
    1.54 -		self.possibleSdks['dota'] =  {'sdk': 'HL2SDKDOTA',     'ext': '2.dota',  'def': '13',
    1.55 +		self.possibleSdks['dota'] =  {'sdk': 'HL2SDKDOTA',     'ext': '2.dota',   'def': '16',
    1.56  		                         'name': 'DOTA',           'platform': ['windows'],
    1.57  		                         'dir': 'hl2sdk-dota'}
    1.58 -		# self.possibleSdks['portal2'] =  {'sdk': 'HL2SDK-PORTAL2',     'ext': '2.portal2',  'def': '11',
    1.59 +		# self.possibleSdks['portal2'] =  {'sdk': 'HL2SDK-PORTAL2',     'ext': '2.portal2',  'def': '14',
    1.60  		#                        'name': 'PORTAL2',           'platform': ['windows'],
    1.61  		#                        'dir': 'hl2sdk-portal2'}
    1.62  		
    1.63 @@ -312,7 +321,7 @@
    1.64  			else:
    1.65  				staticLibs = os.path.join(sdkPath, 'lib', 'linux')
    1.66  			workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
    1.67 -			if sdk in ['ep2v', 'css', 'l4d2']:
    1.68 +			if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'l4d2']:
    1.69  				libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib_srv.so', 'libtier0_srv.so']
    1.70  				for lib in libs:
    1.71  					link = os.path.join(workFolder, lib)
    1.72 @@ -321,7 +330,7 @@
    1.73  						os.lstat(link)
    1.74  					except:
    1.75  						job.AddCommand(SymlinkCommand(link, target))
    1.76 -			elif sdk in ['l4d', 'csgo']:
    1.77 +			elif sdk in ['l4d', 'nd', 'csgo']:
    1.78  				libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so']
    1.79  				if sdk == 'csgo':
    1.80  					libs.append('interfaces_i486.a')
    1.81 @@ -384,7 +393,7 @@
    1.82  				
    1.83  		# We don't build for Portal 2 (yet?, ever?), but using this define in code as 
    1.84  		# it saves trouble if we ever need to
    1.85 -		compiler['CDEFINES'].append('SE_PORTAL2=11')
    1.86 +		compiler['CDEFINES'].append('SE_PORTAL2=14')
    1.87  
    1.88  		paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'],
    1.89  						 ['public', 'tier0'], ['public', 'tier1']]
    1.90 @@ -423,10 +432,10 @@
    1.91  		if not noLink:
    1.92  			if AMBuild.target['platform'] == 'linux':
    1.93  				compiler['POSTLINKFLAGS'][0:0] = ['-lm']
    1.94 -				if sdk in ['ep2v', 'css', 'l4d2']:
    1.95 +				if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'l4d2']:
    1.96  					compiler['POSTLINKFLAGS'][0:0] = ['libtier0_srv.so']
    1.97  					compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib_srv.so']
    1.98 -				elif sdk in ['l4d', 'csgo']:
    1.99 +				elif sdk in ['l4d', 'nd', 'csgo']:
   1.100  					compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so']
   1.101  					compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
   1.102  				else:
     2.1 --- a/core/HalfLife2.cpp	Mon Jul 29 10:03:18 2013 -0400
     2.2 +++ b/core/HalfLife2.cpp	Sun Jul 21 11:53:56 2013 -0400
     2.3 @@ -58,7 +58,7 @@
     2.4  #define TIER0_NAME			"libtier0.dylib"
     2.5  #define VSTDLIB_NAME		"libvstdlib.dylib"
     2.6  #elif defined __linux__
     2.7 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_LEFT4DEAD2
     2.8 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_LEFT4DEAD2
     2.9  #define TIER0_NAME			"libtier0_srv.so"
    2.10  #define VSTDLIB_NAME		"libvstdlib_srv.so"
    2.11  #elif SOURCE_ENGINE >= SE_LEFT4DEAD
     3.1 --- a/core/MenuStyle_Base.cpp	Mon Jul 29 10:03:18 2013 -0400
     3.2 +++ b/core/MenuStyle_Base.cpp	Sun Jul 21 11:53:56 2013 -0400
     3.3 @@ -338,7 +338,7 @@
     3.4  #endif
     3.5  							0, 
     3.6  							PITCH_NORM, 
     3.7 -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
     3.8 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
     3.9  							0,
    3.10  #endif
    3.11  							&pos);
     4.1 --- a/core/PlayerManager.cpp	Mon Jul 29 10:03:18 2013 -0400
     4.2 +++ b/core/PlayerManager.cpp	Sun Jul 21 11:53:56 2013 -0400
     4.3 @@ -266,7 +266,7 @@
     4.4  #endif
     4.5  {
     4.6  	static ConVar *tv_enable = icvar->FindVar("tv_enable");
     4.7 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
     4.8 +#if SOURCE_ENGINE == SE_TF2
     4.9  	static ConVar *replay_enable = icvar->FindVar("replay_enable");
    4.10  #endif
    4.11  
    4.12 @@ -276,7 +276,7 @@
    4.13  	ICommandLine *commandLine = g_HL2.GetValveCommandLine();
    4.14  	m_bIsSourceTVActive = (tv_enable && tv_enable->GetBool() && (!commandLine || commandLine->FindParm("-nohltv") == 0));
    4.15  	m_bIsReplayActive = false;
    4.16 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
    4.17 +#if SOURCE_ENGINE == SE_TF2
    4.18  	m_bIsReplayActive = (replay_enable && replay_enable->GetBool());
    4.19  #endif
    4.20  	m_PlayersSinceActive = 0;
    4.21 @@ -634,17 +634,14 @@
    4.22  		int newCount = m_PlayersSinceActive + 1;
    4.23  
    4.24  		int userId = GetPlayerUserId(pEntity);
    4.25 -#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_LEFT4DEAD2)
    4.26 +#if (SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_LEFT4DEAD2)
    4.27  		static ConVar *tv_name = icvar->FindVar("tv_name");
    4.28  #endif
    4.29 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
    4.30 +#if SOURCE_ENGINE == SE_TF2
    4.31  		static ConVar *replay_name = icvar->FindVar("replay_name");
    4.32  #endif
    4.33 -#if SOURCE_ENGINE == SE_LEFT4DEAD2
    4.34 -		static bool bIsNuclearDawn = (strcmp(g_SourceMod.GetGameFolderName(), "nucleardawn") == 0);
    4.35 -#endif
    4.36  
    4.37 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
    4.38 +#if SOURCE_ENGINE == SE_TF2
    4.39  		if (m_bIsReplayActive && newCount == 1
    4.40  			&& (m_ReplayUserId == userId
    4.41  				|| (replay_name && strcmp(playername, replay_name->GetString()) == 0) || (replay_name && replay_name->GetString()[0] == 0 && strcmp(playername, "unnamed") == 0)
    4.42 @@ -662,15 +659,8 @@
    4.43  			&& (m_SourceTVUserId == userId
    4.44  #if SOURCE_ENGINE == SE_CSGO
    4.45  				|| strcmp(playername, "GOTV") == 0
    4.46 -#elif (SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_LEFT4DEAD2)
    4.47 -#if SOURCE_ENGINE == SE_LEFT4DEAD2
    4.48 -				|| (bIsNuclearDawn && ( true
    4.49 -#endif // SE_LEFT4DEAD2
    4.50 +#elif (SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_NUCLEARDAWN)
    4.51  				|| (tv_name && strcmp(playername, tv_name->GetString()) == 0) || (tv_name && tv_name->GetString()[0] == 0 && strcmp(playername, "unnamed") == 0)
    4.52 -#if SOURCE_ENGINE == SE_LEFT4DEAD2
    4.53 -					))
    4.54 -				|| (!bIsNuclearDawn && strcmp(playername, "SourceTV") == 0)
    4.55 -#endif // SE_LEFT4DEAD2
    4.56  #else
    4.57  				|| strcmp(playername, "SourceTV") == 0
    4.58  #endif
     5.1 --- a/core/convar_sm_l4d.h	Mon Jul 29 10:03:18 2013 -0400
     5.2 +++ b/core/convar_sm_l4d.h	Sun Jul 21 11:53:56 2013 -0400
     5.3 @@ -386,7 +386,7 @@
     5.4  	virtual void				SetValue( const char *value );
     5.5  	virtual void				SetValue( float value );
     5.6  	virtual void				SetValue( int value );
     5.7 -#if SOURCE_ENGINE >= SE_LEFT4DEAD2
     5.8 +#if SOURCE_ENGINE >= SE_NUCLEARDAWN
     5.9  	virtual void				SetValue( Color value );
    5.10  #endif
    5.11  	
     6.1 --- a/core/logic/ExtensionSys.cpp	Mon Jul 29 10:03:18 2013 -0400
     6.2 +++ b/core/logic/ExtensionSys.cpp	Sun Jul 21 11:53:56 2013 -0400
     6.3 @@ -84,6 +84,24 @@
     6.4  		goto found;
     6.5  	}
     6.6  
     6.7 +	/* COMPAT HACK: One-halfth, if ep2v, see if there is an engine specific build in the new place with old naming */
     6.8 +	if (strcmp(smcore.gamesuffix, "2.tf2") == 0
     6.9 +		|| strcmp(smcore.gamesuffix, "2.dods") == 0
    6.10 +		|| strcmp(smcore.gamesuffix, "2.hl2dm") == 0
    6.11 +		)
    6.12 +	{
    6.13 +		g_pSM->BuildPath(Path_SM,
    6.14 +			path,
    6.15 +			PLATFORM_MAX_PATH,
    6.16 +			"extensions/%s.2.ep2v." PLATFORM_LIB_EXT,
    6.17 +			filename);
    6.18 +
    6.19 +		if (libsys->IsPathFile(path))
    6.20 +		{
    6.21 +			goto found;
    6.22 +		}
    6.23 +	}
    6.24 +
    6.25  	/* First see if there is an engine specific build! */
    6.26  	g_pSM->BuildPath(Path_SM, 
    6.27  		path, 
     7.1 --- a/core/logic/GameConfigs.cpp	Mon Jul 29 10:03:18 2013 -0400
     7.2 +++ b/core/logic/GameConfigs.cpp	Sun Jul 21 11:53:56 2013 -0400
     7.3 @@ -54,6 +54,7 @@
     7.4  static char g_Game[256];
     7.5  static char g_GameDesc[256] = {'!', '\0'};
     7.6  static char g_GameName[256] = {'$', '\0'};
     7.7 +static const char *g_pParseEngine = NULL;
     7.8  
     7.9  #define PSTATE_NONE						0
    7.10  #define PSTATE_GAMES					1
    7.11 @@ -112,10 +113,10 @@
    7.12  
    7.13  static bool DoesEngineMatch(const char *value)
    7.14  {
    7.15 -	return strcmp(value, smcore.GetSourceEngineName()) == 0;
    7.16 +	return strcmp(value, g_pParseEngine) == 0;
    7.17  }
    7.18  
    7.19 -CGameConfig::CGameConfig(const char *file)
    7.20 +CGameConfig::CGameConfig(const char *file, const char *engine)
    7.21  {
    7.22  	strncopy(m_File, file, sizeof(m_File));
    7.23  	m_pAddresses = new KTrie<AddressConf>();
    7.24 @@ -124,6 +125,16 @@
    7.25  
    7.26  	m_CustomLevel = 0;
    7.27  	m_CustomHandler = NULL;
    7.28 +
    7.29 +	if (!engine)
    7.30 +		m_pEngine = smcore.GetSourceEngineName();
    7.31 +	else
    7.32 +		m_pEngine = engine;
    7.33 +
    7.34 +	if (strcmp(m_pEngine, "css") == 0 || strcmp(m_pEngine, "dods") == 0 || strcmp(m_pEngine, "hl2dm") == 0 || strcmp(m_pEngine, "tf2") == 0)
    7.35 +		this->SetBaseEngine("orangebox_valve");
    7.36 +	else
    7.37 +		this->SetBaseEngine(NULL);
    7.38  }
    7.39  
    7.40  CGameConfig::~CGameConfig()
    7.41 @@ -772,19 +783,29 @@
    7.42  	SMCStates state = {0, 0};
    7.43  	List<String> fileList;
    7.44  	master_reader.fileList = &fileList;
    7.45 +	const char *pEngine[2] = { m_pBaseEngine, m_pEngine  };
    7.46  
    7.47 -	err = textparsers->ParseSMCFile(path, &master_reader, &state, error, maxlength);
    7.48 -	if (err != SMCError_Okay)
    7.49 +	for (unsigned char iter = 0; iter < SM_ARRAYSIZE(pEngine); ++iter)
    7.50  	{
    7.51 -		const char *msg = textparsers->GetSMCErrorString(err);
    7.52 +		if (pEngine[iter] == NULL)
    7.53 +		{
    7.54 +			continue;
    7.55 +		}
    7.56  
    7.57 -		smcore.LogError("[SM] Error parsing master gameconf file \"%s\":", path);
    7.58 -		smcore.LogError("[SM] Error %d on line %d, col %d: %s", 
    7.59 -			err,
    7.60 -			state.line,
    7.61 -			state.col,
    7.62 -			msg ? msg : "Unknown error");
    7.63 -		return false;
    7.64 +		this->SetParseEngine(pEngine[iter]);
    7.65 +		err = textparsers->ParseSMCFile(path, &master_reader, &state, error, maxlength);
    7.66 +		if (err != SMCError_Okay)
    7.67 +		{
    7.68 +			const char *msg = textparsers->GetSMCErrorString(err);
    7.69 +
    7.70 +			smcore.LogError("[SM] Error parsing master gameconf file \"%s\":", path);
    7.71 +			smcore.LogError("[SM] Error %d on line %d, col %d: %s", 
    7.72 +				err,
    7.73 +				state.line,
    7.74 +				state.col,
    7.75 +				msg ? msg : "Unknown error");
    7.76 +			return false;
    7.77 +		}
    7.78  	}
    7.79  
    7.80  	/* Go through each file we found and parse it. */
    7.81 @@ -850,35 +871,53 @@
    7.82  	m_IgnoreLevel = 0;
    7.83  	bShouldBeReadingDefault = true;
    7.84  	m_ParseState = PSTATE_NONE;
    7.85 -
    7.86 -	if ((err=textparsers->ParseSMCFile(m_CurFile, this, &state, error, maxlength))
    7.87 -		!= SMCError_Okay)
    7.88 -	{
    7.89 -		const char *msg;
    7.90 -
    7.91 -		msg = textparsers->GetSMCErrorString(err);
    7.92 +	const char *pEngine[2] = { m_pBaseEngine, m_pEngine };
    7.93  
    7.94 -		smcore.LogError("[SM] Error parsing gameconfig file \"%s\":", m_CurFile);
    7.95 -		smcore.LogError("[SM] Error %d on line %d, col %d: %s", 
    7.96 -			err,
    7.97 -			state.line,
    7.98 -			state.col,
    7.99 -			msg ? msg : "Unknown error");
   7.100 -
   7.101 -		if (m_ParseState == PSTATE_GAMEDEFS_CUSTOM)
   7.102 +	for (unsigned char iter = 0; iter < SM_ARRAYSIZE(pEngine); ++iter)
   7.103 +	{
   7.104 +		if (pEngine[iter] == NULL)
   7.105  		{
   7.106 -			//error occurred while parsing a custom section
   7.107 -			m_CustomHandler->ReadSMC_ParseEnd(true, true);
   7.108 -			m_CustomHandler = NULL;
   7.109 -			m_CustomLevel = 0;
   7.110 +			continue;
   7.111  		}
   7.112  
   7.113 -		return false;
   7.114 +		this->SetParseEngine(pEngine[iter]);
   7.115 +		if ((err=textparsers->ParseSMCFile(m_CurFile, this, &state, error, maxlength))
   7.116 +			!= SMCError_Okay)
   7.117 +		{
   7.118 +			const char *msg = textparsers->GetSMCErrorString(err);
   7.119 +
   7.120 +			smcore.LogError("[SM] Error parsing gameconfig file \"%s\":", m_CurFile);
   7.121 +			smcore.LogError("[SM] Error %d on line %d, col %d: %s", 
   7.122 +				err,
   7.123 +				state.line,
   7.124 +				state.col,
   7.125 +				msg ? msg : "Unknown error");
   7.126 +
   7.127 +			if (m_ParseState == PSTATE_GAMEDEFS_CUSTOM)
   7.128 +			{
   7.129 +				//error occurred while parsing a custom section
   7.130 +				m_CustomHandler->ReadSMC_ParseEnd(true, true);
   7.131 +				m_CustomHandler = NULL;
   7.132 +				m_CustomLevel = 0;
   7.133 +			}
   7.134 +
   7.135 +			return false;
   7.136 +		}
   7.137  	}
   7.138  
   7.139  	return true;
   7.140  }
   7.141  
   7.142 +void CGameConfig::SetBaseEngine(const char *engine)
   7.143 +{
   7.144 +	m_pBaseEngine = engine;
   7.145 +}
   7.146 +
   7.147 +void CGameConfig::SetParseEngine(const char *engine)
   7.148 +{
   7.149 +	g_pParseEngine = engine;
   7.150 +}
   7.151 +
   7.152  bool CGameConfig::GetOffset(const char *key, int *value)
   7.153  {
   7.154  	int *pvalue;
     8.1 --- a/core/logic/GameConfigs.h	Mon Jul 29 10:03:18 2013 -0400
     8.2 +++ b/core/logic/GameConfigs.h	Sun Jul 21 11:53:56 2013 -0400
     8.3 @@ -50,11 +50,13 @@
     8.4  {
     8.5  	friend class GameConfigManager;
     8.6  public:
     8.7 -	CGameConfig(const char *file);
     8.8 +	CGameConfig(const char *file, const char *engine = NULL);
     8.9  	~CGameConfig();
    8.10  public:
    8.11  	bool Reparse(char *error, size_t maxlength);
    8.12  	bool EnterFile(const char *file, char *error, size_t maxlength);
    8.13 +	void SetBaseEngine(const char *engine);
    8.14 +	void SetParseEngine(const char *engine);
    8.15  public: //ITextListener_SMC
    8.16  	SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
    8.17  	SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value);
    8.18 @@ -111,6 +113,8 @@
    8.19  	int m_AddressReadCount;
    8.20  	int m_AddressRead[8];
    8.21  	KTrie<AddressConf> *m_pAddresses;
    8.22 +	const char *m_pEngine;
    8.23 +	const char *m_pBaseEngine;
    8.24  };
    8.25  
    8.26  class GameConfigManager : 
     9.1 --- a/core/logic_bridge.cpp	Mon Jul 29 10:03:18 2013 -0400
     9.2 +++ b/core/logic_bridge.cpp	Sun Jul 21 11:53:56 2013 -0400
     9.3 @@ -214,10 +214,16 @@
     9.4  	return "eye";
     9.5  #elif SOURCE_ENGINE == SE_CSS
     9.6  	return "css";
     9.7 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
     9.8 -	return "orangebox_valve";
     9.9 +#elif SOURCE_ENGINE == SE_HL2DM
    9.10 +	return "hl2dm";
    9.11 +#elif SOURCE_ENGINE == SE_DODS
    9.12 +	return "dods";
    9.13 +#elif SOURCE_ENGINE == SE_TF2
    9.14 +	return "tf2";
    9.15  #elif SOURCE_ENGINE == SE_LEFT4DEAD
    9.16  	return "left4dead";
    9.17 +#elif SOURCE_ENGINE == SE_NUCLEARDAWN
    9.18 +	return "nucleardawn";
    9.19  #elif SOURCE_ENGINE == SE_LEFT4DEAD2
    9.20  	return "left4dead2";
    9.21  #elif SOURCE_ENGINE == SE_ALIENSWARM
    9.22 @@ -233,7 +239,7 @@
    9.23  
    9.24  static bool symbols_are_hidden()
    9.25  {
    9.26 -#if (SOURCE_ENGINE == SE_CSS) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_CSGO) || (SOURCE_ENGINE == SE_DOTA)
    9.27 +#if (SOURCE_ENGINE == SE_CSS) || (SOURCE_ENGINE == SE_HL2DM) || (SOURCE_ENGINE == SE_DODS) || (SOURCE_ENGINE == SE_TF2) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_NUCLEARDAWN) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_CSGO) || (SOURCE_ENGINE == SE_DOTA)
    9.28  	return true;
    9.29  #else
    9.30  	return false;
    9.31 @@ -321,8 +327,12 @@
    9.32  #define GAMEFIX "2.eye"
    9.33  #elif SOURCE_ENGINE == SE_CSS
    9.34  #define GAMEFIX "2.css"
    9.35 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
    9.36 -#define GAMEFIX "2.ep2v"
    9.37 +#elif SOURCE_ENGINE == SE_HL2DM
    9.38 +#define GAMEFIX "2.hl2dm"
    9.39 +#elif SOURCE_ENGINE == SE_DODS
    9.40 +#define GAMEFIX "2.dods"
    9.41 +#elif SOURCE_ENGINE == SE_TF2
    9.42 +#define GAMEFIX "2.tf2"
    9.43  #elif SOURCE_ENGINE == SE_DARKMESSIAH
    9.44  #define GAMEFIX "2.darkm"
    9.45  #elif SOURCE_ENGINE == SE_PORTAL2
    10.1 --- a/core/smn_console.cpp	Mon Jul 29 10:03:18 2013 -0400
    10.2 +++ b/core/smn_console.cpp	Sun Jul 21 11:53:56 2013 -0400
    10.3 @@ -916,7 +916,7 @@
    10.4  
    10.5  bool g_ShouldCatchSpew = false;
    10.6  
    10.7 -#if SOURCE_ENGINE < SE_LEFT4DEAD2
    10.8 +#if SOURCE_ENGINE < SE_NUCLEARDAWN
    10.9  SpewOutputFunc_t g_OriginalSpewOutputFunc = NULL;
   10.10  
   10.11  SpewRetval_t SourcemodSpewOutputFunc(SpewType_t spewType, tchar const *pMsg)
   10.12 @@ -955,7 +955,7 @@
   10.13  		return;
   10.14  	}
   10.15  
   10.16 -#if SOURCE_ENGINE < SE_LEFT4DEAD2
   10.17 +#if SOURCE_ENGINE < SE_NUCLEARDAWN
   10.18  	g_OriginalSpewOutputFunc = GetSpewOutputFunc();
   10.19  	SpewOutputFunc(SourcemodSpewOutputFunc);
   10.20  #else
   10.21 @@ -976,7 +976,7 @@
   10.22  		return;
   10.23  	}
   10.24  
   10.25 -#if SOURCE_ENGINE < SE_LEFT4DEAD2
   10.26 +#if SOURCE_ENGINE < SE_NUCLEARDAWN
   10.27  	SpewOutputFunc(g_OriginalSpewOutputFunc);
   10.28  #else
   10.29  	LoggingSystem_PopLoggingState(false);
    11.1 --- a/core/smn_entities.cpp	Mon Jul 29 10:03:18 2013 -0400
    11.2 +++ b/core/smn_entities.cpp	Sun Jul 21 11:53:56 2013 -0400
    11.3 @@ -1208,7 +1208,7 @@
    11.4  			is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
    11.5  
    11.6  			// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
    11.7 -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
    11.8 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
    11.9  			if (pProp->GetFlags() & SPROP_VARINT)
   11.10  			{
   11.11  				bit_count = sizeof(int) * 8;
   11.12 @@ -1306,7 +1306,7 @@
   11.13  			FIND_PROP_SEND(DPT_Int, "integer");
   11.14  
   11.15  			// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
   11.16 -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
   11.17 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   11.18  			if (pProp->GetFlags() & SPROP_VARINT)
   11.19  			{
   11.20  				bit_count = sizeof(int) * 8;
   11.21 @@ -2030,7 +2030,7 @@
   11.22  #if SOURCE_ENGINE == SE_ALIENSWARM
   11.23  		case FL_FREEZING:
   11.24  			return ENTFLAG_FREEZING;
   11.25 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   11.26 +#elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
   11.27  		case FL_EP2V_UNKNOWN:
   11.28  			return ENTFLAG_EP2V_UNKNOWN1;
   11.29  #endif
   11.30 @@ -2108,7 +2108,7 @@
   11.31  #if SOURCE_ENGINE == SE_ALIENSWARM
   11.32  		case ENTFLAG_FREEZING:
   11.33  			return FL_FREEZING;
   11.34 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   11.35 +#elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
   11.36  		case ENTFLAG_EP2V_UNKNOWN1:
   11.37  			return FL_EP2V_UNKNOWN;
   11.38  #endif
    12.1 --- a/core/smn_halflife.cpp	Mon Jul 29 10:03:18 2013 -0400
    12.2 +++ b/core/smn_halflife.cpp	Sun Jul 21 11:53:56 2013 -0400
    12.3 @@ -72,7 +72,7 @@
    12.4  
    12.5  static cell_t GetEngineTime(IPluginContext *pContext, const cell_t *params)
    12.6  {
    12.7 -#if SOURCE_ENGINE >= SE_LEFT4DEAD2
    12.8 +#if SOURCE_ENGINE >= SE_NUCLEARDAWN
    12.9  	float fTime = Plat_FloatTime();
   12.10  #else
   12.11  	float fTime = engine->Time();
   12.12 @@ -493,10 +493,13 @@
   12.13  		return 33;
   12.14  	case SOURCE_ENGINE_CSS:
   12.15  		return 34;
   12.16 -	case SOURCE_ENGINE_ORANGEBOXVALVE:
   12.17 +	case SOURCE_ENGINE_HL2DM:
   12.18 +	case SOURCE_ENGINE_DODS:
   12.19 +	case SOURCE_ENGINE_TF2:
   12.20  		return 35;
   12.21  	case SOURCE_ENGINE_LEFT4DEAD:
   12.22  		return 40;
   12.23 +	case SOURCE_ENGINE_NUCLEARDAWN:
   12.24  	case SOURCE_ENGINE_LEFT4DEAD2:
   12.25  		return 50;
   12.26  	case SOURCE_ENGINE_ALIENSWARM:
   12.27 @@ -523,6 +526,11 @@
   12.28  	return 0;
   12.29  }
   12.30  
   12.31 +static cell_t GetEngineVersion(IPluginContext *pContext, const cell_t *params)
   12.32 +{
   12.33 +	return g_SMAPI->GetSourceEngineBuild();
   12.34 +}
   12.35 +
   12.36  static cell_t IndexToReference(IPluginContext *pContext, const cell_t *params)
   12.37  {
   12.38  	if (params[1] >= NUM_ENT_ENTRIES || params[1] < 0)
   12.39 @@ -574,6 +582,7 @@
   12.40  	{"ShowVGUIPanel",			ShowVGUIPanel},
   12.41  	{"IsPlayerAlive",			smn_IsPlayerAlive},
   12.42  	{"GuessSDKVersion",			GuessSDKVersion},
   12.43 +	{"GetEngineVersion",		GetEngineVersion},
   12.44  	{"EntIndexToEntRef",		IndexToReference},
   12.45  	{"EntRefToEntIndex",		ReferenceToIndex},
   12.46  	{"MakeCompatEntRef",		ReferenceToBCompatRef},
    13.1 --- a/extensions/sdkhooks/extension.cpp	Mon Jul 29 10:03:18 2013 -0400
    13.2 +++ b/extensions/sdkhooks/extension.cpp	Sun Jul 21 11:53:56 2013 -0400
    13.3 @@ -148,7 +148,7 @@
    13.4  SH_DECL_MANUALHOOK1_void(StartTouch, 0, 0, 0, CBaseEntity *);
    13.5  SH_DECL_MANUALHOOK0_void(Think, 0, 0, 0);
    13.6  SH_DECL_MANUALHOOK1_void(Touch, 0, 0, 0, CBaseEntity *);
    13.7 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
    13.8 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
    13.9  SH_DECL_MANUALHOOK4_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *, void *);
   13.10  #else
   13.11  SH_DECL_MANUALHOOK3_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *);
   13.12 @@ -1244,7 +1244,7 @@
   13.13  	RETURN_META(MRES_IGNORED);
   13.14  }
   13.15  
   13.16 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   13.17 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
   13.18  void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK)
   13.19  #else
   13.20  void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr)
   13.21 @@ -1309,7 +1309,7 @@
   13.22  	RETURN_META(MRES_IGNORED);
   13.23  }
   13.24  
   13.25 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   13.26 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
   13.27  void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK)
   13.28  #else
   13.29  void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr)
    14.1 --- a/extensions/sdkhooks/extension.h	Mon Jul 29 10:03:18 2013 -0400
    14.2 +++ b/extensions/sdkhooks/extension.h	Sun Jul 21 11:53:56 2013 -0400
    14.3 @@ -19,7 +19,7 @@
    14.4  #if SOURCE_ENGINE >= SE_CSS && SOURCE_ENGINE != SE_LEFT4DEAD
    14.5  #define GETMAXHEALTH_IS_VIRTUAL
    14.6  #endif
    14.7 -#if SOURCE_ENGINE != SE_ORANGEBOXVALVE && SOURCE_ENGINE != SE_CSS && SOURCE_ENGINE != SE_LEFT4DEAD2 && SOURCE_ENGINE != SE_CSGO
    14.8 +#if SOURCE_ENGINE != SE_HL2DM && SOURCE_ENGINE != SE_DODS && SOURCE_ENGINE != SE_CSS && SOURCE_ENGINE != SE_TF2 && SOURCE_ENGINE != SE_LEFT4DEAD2 && SOURCE_ENGINE != SE_CSGO && SOURCE_ENGINE != SE_NUCLEARDAWN
    14.9  #define GAMEDESC_CAN_CHANGE
   14.10  #endif
   14.11  
   14.12 @@ -264,7 +264,7 @@
   14.13  	void Hook_ThinkPost();
   14.14  	void Hook_Touch(CBaseEntity *pOther);
   14.15  	void Hook_TouchPost(CBaseEntity *pOther);
   14.16 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   14.17 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
   14.18  	void Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK);
   14.19  	void Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK);
   14.20  #else
    15.1 --- a/extensions/sdkhooks/takedamageinfohack.cpp	Mon Jul 29 10:03:18 2013 -0400
    15.2 +++ b/extensions/sdkhooks/takedamageinfohack.cpp	Sun Jul 21 11:53:56 2013 -0400
    15.3 @@ -62,7 +62,7 @@
    15.4  	m_vecReportedPosition = vec3_origin;
    15.5  	m_iAmmoType = -1;
    15.6  
    15.7 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
    15.8 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
    15.9  	m_iDamagedOtherPlayers = 0;
   15.10  	m_iPlayerPenetrateCount = 0;
   15.11  	m_flUnknown = 0.0f;
    16.1 --- a/extensions/sdktools/gamerulesnatives.cpp	Mon Jul 29 10:03:18 2013 -0400
    16.2 +++ b/extensions/sdktools/gamerulesnatives.cpp	Sun Jul 21 11:53:56 2013 -0400
    16.3 @@ -174,7 +174,7 @@
    16.4  	is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
    16.5  
    16.6  	// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
    16.7 -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
    16.8 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
    16.9  	if (pProp->GetFlags() & SPROP_VARINT)
   16.10  	{
   16.11  		bit_count = sizeof(int) * 8;
   16.12 @@ -243,8 +243,7 @@
   16.13  
   16.14  	FIND_PROP_SEND(DPT_Int, "integer");
   16.15  
   16.16 -	// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
   16.17 -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE
   16.18 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   16.19  	if (pProp->GetFlags() & SPROP_VARINT)
   16.20  	{
   16.21  		bit_count = sizeof(int) * 8;
    17.1 --- a/extensions/sdktools/vcaller.cpp	Mon Jul 29 10:03:18 2013 -0400
    17.2 +++ b/extensions/sdktools/vcaller.cpp	Sun Jul 21 11:53:56 2013 -0400
    17.3 @@ -129,7 +129,7 @@
    17.4  		{
    17.5  			return 0;
    17.6  		}
    17.7 -#if (SOURCE_ENGINE == SE_CSS) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_CSGO)
    17.8 +#if (SOURCE_ENGINE == SE_CSS) || (SOURCE_ENGINE == SE_HL2DM) || (SOURCE_ENGINE == SE_DODS) || (SOURCE_ENGINE == SE_TF2) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_NUCLEARDAWN) || (SOURCE_ENGINE == SE_CSGO)
    17.9  		s_call_addr = memutils->ResolveSymbol(handle, &sig[1]);
   17.10  #else
   17.11  		s_call_addr = dlsym(handle, &sig[1]);
    18.1 --- a/extensions/sdktools/vnatives.cpp	Mon Jul 29 10:03:18 2013 -0400
    18.2 +++ b/extensions/sdktools/vnatives.cpp	Sun Jul 21 11:53:56 2013 -0400
    18.3 @@ -532,7 +532,7 @@
    18.4  			CellRecipientFilter rf;
    18.5  			rf.SetToReliable(true);
    18.6  			rf.Initialize(player_list, total_players);
    18.7 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
    18.8 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
    18.9  			engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, 0, &pos);
   18.10  #elif SOURCE_ENGINE < SE_PORTAL2
   18.11  			engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, &pos);
    19.1 --- a/extensions/sdktools/vsound.cpp	Mon Jul 29 10:03:18 2013 -0400
    19.2 +++ b/extensions/sdktools/vsound.cpp	Sun Jul 21 11:53:56 2013 -0400
    19.3 @@ -41,7 +41,7 @@
    19.4  #if SOURCE_ENGINE >= SE_PORTAL2
    19.5  SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 0, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
    19.6  SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 1, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
    19.7 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
    19.8 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
    19.9  SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 0, IRecipientFilter &, int, int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
   19.10  SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 1, IRecipientFilter &, int, int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
   19.11  #else
   19.12 @@ -288,7 +288,7 @@
   19.13  							 float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, 
   19.14  							 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   19.15  							 float soundtime, int speakerentity)
   19.16 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   19.17 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   19.18  void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample, 
   19.19  							 float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, 
   19.20  							 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   19.21 @@ -349,7 +349,7 @@
   19.22  					(crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, iSoundlevel, nSeed, iFlags, iPitch, pOrigin, 
   19.23  					pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
   19.24  					);
   19.25 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   19.26 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   19.27  				RETURN_META_NEWPARAMS(
   19.28  					MRES_IGNORED,
   19.29  					static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float, soundlevel_t, 
   19.30 @@ -380,7 +380,7 @@
   19.31  							 float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, 
   19.32  							 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   19.33  							 float soundtime, int speakerentity)
   19.34 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   19.35 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   19.36  void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample, 
   19.37  							 float flVolume, float flAttenuation, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, 
   19.38  							 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   19.39 @@ -442,7 +442,7 @@
   19.40  					(crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, SNDLVL_TO_ATTN(static_cast<soundlevel_t>(sndlevel)), 
   19.41  					nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
   19.42  					);
   19.43 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   19.44 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   19.45  RETURN_META_NEWPARAMS(
   19.46  					MRES_IGNORED,
   19.47  					static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char *, float, float, 
   19.48 @@ -711,7 +711,7 @@
   19.49  					soundtime,
   19.50  					speakerentity);
   19.51  			}
   19.52 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   19.53 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   19.54  			if (g_InSoundHook)
   19.55  			{
   19.56  				SH_CALL(enginesoundPatch, 
   19.57 @@ -839,7 +839,7 @@
   19.58  				soundtime,
   19.59  				speakerentity);
   19.60  		}
   19.61 -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   19.62 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   19.63  		if (g_InSoundHook)
   19.64  		{
   19.65  			SH_CALL(enginesoundPatch, 
   19.66 @@ -1012,7 +1012,7 @@
   19.67  #endif
   19.68  		flags, 
   19.69  		pitch, 
   19.70 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   19.71 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   19.72  		0, 
   19.73  #endif
   19.74  		pOrigin,
    20.1 --- a/extensions/sdktools/vsound.h	Mon Jul 29 10:03:18 2013 -0400
    20.2 +++ b/extensions/sdktools/vsound.h	Sun Jul 21 11:53:56 2013 -0400
    20.3 @@ -67,7 +67,7 @@
    20.4  		const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
    20.5  		float soundtime, int speakerentity);
    20.6  #else
    20.7 -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
    20.8 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
    20.9  	
   20.10  	void OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume, 
   20.11  		soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, 
   20.12 @@ -86,7 +86,7 @@
   20.13  		float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin, 
   20.14  		const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions, 
   20.15  		float soundtime, int speakerentity);
   20.16 -#endif // SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
   20.17 +#endif // SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2
   20.18  #endif // SOURCE_ENGINE >= SE_PORTAL2
   20.19  private:
   20.20  	size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter);
    21.1 --- a/extensions/tf2/AMBuilder	Mon Jul 29 10:03:18 2013 -0400
    21.2 +++ b/extensions/tf2/AMBuilder	Sun Jul 21 11:53:56 2013 -0400
    21.3 @@ -1,13 +1,13 @@
    21.4  # vim: set ts=2 sw=2 tw=99 noet ft=python: 
    21.5  import os
    21.6 -if 'ep2v' in SM.sdkInfo:
    21.7 -	sdk = SM.sdkInfo['ep2v']
    21.8 -	compiler = SM.DefaultHL2Compiler('extensions/tf2', 'ep2v')
    21.9 +if 'tf2' in SM.sdkInfo:
   21.10 +	sdk = SM.sdkInfo['tf2']
   21.11 +	compiler = SM.DefaultHL2Compiler('extensions/tf2', 'tf2')
   21.12  
   21.13  	name = 'game.tf2.ext.' + sdk['ext']
   21.14  	extension = AMBuild.AddJob(name)
   21.15  	binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
   21.16 -	SM.PreSetupHL2Job(extension, binary, 'ep2v')
   21.17 +	SM.PreSetupHL2Job(extension, binary, 'tf2')
   21.18  	binary.AddSourceFiles('extensions/tf2', [
   21.19  		'extension.cpp',
   21.20  		'natives.cpp',
   21.21 @@ -22,7 +22,7 @@
   21.22  		'sdk/smsdk_ext.cpp',
   21.23  		'asm/asm.c'
   21.24  		])
   21.25 -	SM.PostSetupHL2Job(extension, binary, 'ep2v')
   21.26 +	SM.PostSetupHL2Job(extension, binary, 'tf2')
   21.27  	SM.AutoVersion('extensions/tf2', binary)
   21.28  	SM.ExtractDebugInfo(extension, binary)
   21.29  	binary.SendToJob()
    22.1 --- a/loader/loader.cpp	Mon Jul 29 10:03:18 2013 -0400
    22.2 +++ b/loader/loader.cpp	Sun Jul 21 11:53:56 2013 -0400
    22.3 @@ -68,7 +68,6 @@
    22.4  #define METAMOD_API_MAJOR			2
    22.5  #define FILENAME_1_4_EP1			"sourcemod.1.ep1" PLATFORM_EXT
    22.6  #define FILENAME_1_6_EP2			"sourcemod.2.ep2" PLATFORM_EXT
    22.7 -#define FILENAME_1_6_EP2VALVE		"sourcemod.2.ep2v" PLATFORM_EXT
    22.8  #define FILENAME_1_6_EP1			"sourcemod.2.ep1" PLATFORM_EXT
    22.9  #define FILENAME_1_6_L4D			"sourcemod.2.l4d" PLATFORM_EXT
   22.10  #define FILENAME_1_6_DARKM			"sourcemod.2.darkm" PLATFORM_EXT
   22.11 @@ -79,6 +78,10 @@
   22.12  #define FILENAME_1_6_PORTAL2		"sourcemod.2.portal2" PLATFORM_EXT
   22.13  #define FILENAME_1_6_CSGO			"sourcemod.2.csgo" PLATFORM_EXT
   22.14  #define FILENAME_1_6_CSS			"sourcemod.2.css" PLATFORM_EXT
   22.15 +#define FILENAME_1_6_HL2DM			"sourcemod.2.hl2dm" PLATFORM_EXT
   22.16 +#define FILENAME_1_6_DODS			"sourcemod.2.dods" PLATFORM_EXT
   22.17 +#define FILENAME_1_6_TF2			"sourcemod.2.tf2" PLATFORM_EXT
   22.18 +#define FILENAME_1_6_ND				"sourcemod.2.nd" PLATFORM_EXT
   22.19  #define FILENAME_1_6_DOTA			"sourcemod.2.dota" PLATFORM_EXT
   22.20  
   22.21  HINSTANCE g_hCore = NULL;
   22.22 @@ -236,16 +239,16 @@
   22.23  			filename = FILENAME_1_6_DARKM;
   22.24  			break;
   22.25  		}
   22.26 -	case SOURCE_ENGINE_ORANGEBOXVALVE:
   22.27 -		{
   22.28 -			filename = FILENAME_1_6_EP2VALVE;
   22.29 -			break;
   22.30 -		}
   22.31  	case SOURCE_ENGINE_LEFT4DEAD2:
   22.32  		{
   22.33  			filename = FILENAME_1_6_L4D2;
   22.34  			break;
   22.35  		}
   22.36 +	case SOURCE_ENGINE_NUCLEARDAWN:
   22.37 +		{
   22.38 +			filename = FILENAME_1_6_ND;
   22.39 +			break;
   22.40 +		}
   22.41  	case SOURCE_ENGINE_ALIENSWARM:
   22.42  		{
   22.43  			filename = FILENAME_1_6_SWARM;
   22.44 @@ -276,6 +279,42 @@
   22.45  			filename = FILENAME_1_6_CSS;
   22.46  			break;
   22.47  		}
   22.48 +	case SOURCE_ENGINE_HL2DM:
   22.49 +		{
   22.50 +			filename = FILENAME_1_6_HL2DM;
   22.51 +			break;
   22.52 +		}
   22.53 +	case SOURCE_ENGINE_DODS:
   22.54 +		{
   22.55 +			filename = FILENAME_1_6_DODS;
   22.56 +			break;
   22.57 +		}
   22.58 +	case SOURCE_ENGINE_TF2:
   22.59 +		{
   22.60 +			filename = FILENAME_1_6_TF2;
   22.61 +			break;
   22.62 +		}
   22.63 +	case SOURCE_ENGINE_ORANGEBOXVALVE_DEPRECATED:
   22.64 +		{
   22.65 +			const char *gamedir = mvi->GetGameDir();
   22.66 +			if (strcmp(gamedir, "tf") == 0)
   22.67 +			{
   22.68 +				filename = FILENAME_1_6_TF2;
   22.69 +			}
   22.70 +			else if (strcmp(gamedir, "dod") == 0)
   22.71 +			{
   22.72 +				filename = FILENAME_1_6_DODS;
   22.73 +			}
   22.74 +			else if (strcmp(gamedir, "hl2mp") == 0)
   22.75 +			{
   22.76 +				filename = FILENAME_1_6_HL2DM;
   22.77 +			}
   22.78 +			else
   22.79 +			{
   22.80 +				return NULL;
   22.81 +			}
   22.82 +			break;
   22.83 +		}
   22.84  	case SOURCE_ENGINE_DOTA:
   22.85  		{
   22.86  			filename = FILENAME_1_6_DOTA;
    23.1 --- a/plugins/basechat.sp	Mon Jul 29 10:03:18 2013 -0400
    23.2 +++ b/plugins/basechat.sp	Sun Jul 21 11:53:56 2013 -0400
    23.3 @@ -51,13 +51,13 @@
    23.4  
    23.5  new Handle:g_Cvar_Chatmode = INVALID_HANDLE;
    23.6  
    23.7 -new g_GameEngine = SOURCE_SDK_UNKNOWN;
    23.8 +new EngineVersion:g_GameEngine = Engine_Unknown;
    23.9  
   23.10  public OnPluginStart()
   23.11  {
   23.12  	LoadTranslations("common.phrases");
   23.13  	
   23.14 -	g_GameEngine = GuessSDKVersion();
   23.15 +	g_GameEngine = GetEngineVersion();
   23.16  
   23.17  	g_Cvar_Chatmode = CreateConVar("sm_chat_mode", "1", "Allows player's to send messages to admin chat.", 0, true, 0.0, true, 1.0);
   23.18  
   23.19 @@ -67,7 +67,7 @@
   23.20  	RegAdminCmd("sm_csay", Command_SmCsay, ADMFLAG_CHAT, "sm_csay <message> - sends centered message to all players");
   23.21  	
   23.22  	/* HintText does not work on Dark Messiah */
   23.23 -	if (g_GameEngine != SOURCE_SDK_DARKMESSIAH)
   23.24 +	if (g_GameEngine != Engine_DarkMessiah)
   23.25  	{
   23.26  		RegAdminCmd("sm_hsay", Command_SmHsay, ADMFLAG_CHAT, "sm_hsay <message> - sends hint message to all players");	
   23.27  	}
    24.1 --- a/plugins/funcommands.sp	Mon Jul 29 10:03:18 2013 -0400
    24.2 +++ b/plugins/funcommands.sp	Sun Jul 21 11:53:56 2013 -0400
    24.3 @@ -78,7 +78,7 @@
    24.4  // Serial Generator for Timer Safety
    24.5  new g_Serial_Gen = 0;
    24.6  
    24.7 -new g_GameEngine = SOURCE_SDK_UNKNOWN;
    24.8 +new EngineVersion:g_GameEngine = Engine_Unknown;
    24.9  
   24.10  // Flags used in various timers
   24.11  #define DEFAULT_TIMER_FLAGS TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE
   24.12 @@ -102,7 +102,7 @@
   24.13  	
   24.14  	LoadTranslations("common.phrases");
   24.15  	LoadTranslations("funcommands.phrases");
   24.16 -	g_GameEngine = GuessSDKVersion();
   24.17 +	g_GameEngine = GetEngineVersion();
   24.18  	g_FadeUserMsgId = GetUserMessageId("Fade");
   24.19  
   24.20  	RegisterCvars( );
   24.21 @@ -185,25 +185,26 @@
   24.22  	PrecacheSound(SOUND_BOOM, true);
   24.23  	PrecacheSound(SOUND_FREEZE, true);
   24.24  
   24.25 -	new sdkversion = GuessSDKVersion();
   24.26 -	if (sdkversion >= SOURCE_SDK_LEFT4DEAD)
   24.27 +	new EngineVersion:sdkversion = GetEngineVersion();
   24.28 +	if (sdkversion == Engine_Left4Dead || sdkversion == Engine_Left4Dead2
   24.29 +		 || sdkversion == Engine_AlienSwarm || sdkversion == Engine_CSGO)
   24.30  	{
   24.31  		g_BeamSprite = PrecacheModel("materials/sprites/laserbeam.vmt");
   24.32  		g_HaloSprite = PrecacheModel("materials/sprites/glow01.vmt");
   24.33  		
   24.34  		// l4d, l4d2, and csgo have this. swarm does not.
   24.35 -		if (sdkversion != SOURCE_SDK_ALIENSWARM)
   24.36 +		if (sdkversion != Engine_AlienSwarm)
   24.37  		{
   24.38  			g_BeamSprite2 = PrecacheModel("materials/sprites/physbeam.vmt");
   24.39  		}
   24.40  		
   24.41  		g_GlowSprite = PrecacheModel("materials/sprites/blueflare1.vmt");
   24.42  		
   24.43 -		if (sdkversion == SOURCE_SDK_LEFT4DEAD || sdkversion == SOURCE_SDK_LEFT4DEAD2)
   24.44 +		if (sdkversion == Engine_Left4Dead || sdkversion == Engine_Left4Dead2)
   24.45  		{
   24.46  			g_ExplosionSprite = PrecacheModel("sprites/floorfire4_.vmt");
   24.47  		}
   24.48 -		else if (sdkversion == SOURCE_SDK_ALIENSWARM)
   24.49 +		else if (sdkversion == Engine_AlienSwarm)
   24.50  		{
   24.51  			g_ExplosionSprite = PrecacheModel("sprites/flamelet1.vmt");
   24.52  		}
    25.1 --- a/plugins/funcommands/ice.sp	Mon Jul 29 10:03:18 2013 -0400
    25.2 +++ b/plugins/funcommands/ice.sp	Sun Jul 21 11:53:56 2013 -0400
    25.3 @@ -157,7 +157,7 @@
    25.4  		UnfreezeClient(client);
    25.5  		
    25.6  		/* HintText doesn't work on Dark Messiah */
    25.7 -		if (g_GameEngine != SOURCE_SDK_DARKMESSIAH)
    25.8 +		if (g_GameEngine != Engine_DarkMessiah)
    25.9  		{
   25.10  			PrintHintText(client, "%t", "Unfrozen");
   25.11  		}
   25.12 @@ -169,7 +169,7 @@
   25.13  		return Plugin_Stop;
   25.14  	}
   25.15  
   25.16 -	if (g_GameEngine != SOURCE_SDK_DARKMESSIAH)
   25.17 +	if (g_GameEngine != Engine_DarkMessiah)
   25.18  	{
   25.19  		PrintHintText(client, "%t", "You will be unfrozen", g_FreezeTime[client]);
   25.20  	}
    26.1 --- a/plugins/include/halflife.inc	Mon Jul 29 10:03:18 2013 -0400
    26.2 +++ b/plugins/include/halflife.inc	Sun Jul 21 11:53:56 2013 -0400
    26.3 @@ -64,6 +64,28 @@
    26.4  	DialogType_AskConnect	/**< ask the client to connect to a specified IP */
    26.5  };
    26.6  
    26.7 +enum EngineVersion
    26.8 +{
    26.9 +	Engine_Unknown,				/**< Could not determine the engine version */
   26.10 +	Engine_Original,				/**< Original Source Engine (used by The Ship) */
   26.11 +	Engine_SourceSDK2006,		/**< Episode 1 Source Engine (second major SDK) */
   26.12 +	Engine_SourceSDK2007,		/**< Orange Box Source Engine (third major SDK) */
   26.13 +	Engine_Left4Dead,			/**< Left 4 Dead */
   26.14 +	Engine_DarkMessiah,			/**< Dark Messiah Multiplayer (based on original engine) */
   26.15 +	Engine_Left4Dead2 = 7,		/**< Left 4 Dead 2 */
   26.16 +	Engine_AlienSwarm,			/**< Alien Swarm (and Alien Swarm SDK) */
   26.17 +	Engine_BloodyGoodTime,		/**< Bloody Good Time */
   26.18 +	Engine_EYE,					/**< E.Y.E Divine Cybermancy */
   26.19 +	Engine_Portal2,				/**< Portal 2 */
   26.20 +	Engine_CSGO,				/**< Counter-Strike: Global Offensive */
   26.21 +	Engine_CSS,					/**< Counter-Strike: Source */
   26.22 +	Engine_DOTA,				/**< Dota 2 */
   26.23 +	Engine_HL2DM,				/**< Half-Life 2 Deathmatch */
   26.24 +	Engine_DODS,				/**< Day of Defeat: Source */
   26.25 +	Engine_TF2,					/**< Team Fortress 2 */
   26.26 +	Engine_NuclearDawn			/**< Nuclear Dawn */
   26.27 +};
   26.28 +
   26.29  #define INVALID_ENT_REFERENCE 0xFFFFFFFF
   26.30  
   26.31  /**
   26.32 @@ -264,9 +286,20 @@
   26.33   *
   26.34   * @return				SOURCE_SDK version code.
   26.35   */
   26.36 +#pragma deprecated See GetEngineVersion()
   26.37  native GuessSDKVersion();
   26.38  
   26.39  /**
   26.40 + * Gets the engine version that the currently-loaded SM core was compiled against.
   26.41 + *
   26.42 + * The engine version values are not guaranteed to be in any particular order,
   26.43 + * and should only be compared by (in)equality.
   26.44 + *
   26.45 + * @return				An EngineVersion value.
   26.46 + */
   26.47 +native EngineVersion:GetEngineVersion();
   26.48 +
   26.49 +/**
   26.50   * Prints a message to a specific client in the chat area.
   26.51   *
   26.52   * @param client		Client index.
    27.1 --- a/plugins/playercommands.sp	Mon Jul 29 10:03:18 2013 -0400
    27.2 +++ b/plugins/playercommands.sp	Sun Jul 21 11:53:56 2013 -0400
    27.3 @@ -51,7 +51,7 @@
    27.4  
    27.5  /* Used to get the SDK / Engine version. */
    27.6  /* This is used in sm_rename and sm_changeteam */
    27.7 -new g_ModVersion = 0;
    27.8 +new EngineVersion:g_ModVersion = Engine_Unknown;
    27.9  
   27.10  #include "playercommands/slay.sp"
   27.11  #include "playercommands/slap.sp"
   27.12 @@ -66,7 +66,7 @@
   27.13  	RegAdminCmd("sm_slay", Command_Slay, ADMFLAG_SLAY, "sm_slay <#userid|name>");
   27.14  	RegAdminCmd("sm_rename", Command_Rename, ADMFLAG_SLAY, "sm_rename <#userid|name>");
   27.15  
   27.16 -	g_ModVersion = GuessSDKVersion();
   27.17 +	g_ModVersion = GetEngineVersion();
   27.18  	
   27.19  	/* Account for late loading */
   27.20  	new Handle:topmenu;
    28.1 --- a/plugins/playercommands/rename.sp	Mon Jul 29 10:03:18 2013 -0400
    28.2 +++ b/plugins/playercommands/rename.sp	Sun Jul 21 11:53:56 2013 -0400
    28.3 @@ -38,7 +38,7 @@
    28.4  	LogAction(client, target, "\"%L\" renamed \"%L\" to \"%s\")", client, target, g_NewName[target]);
    28.5  
    28.6  	/* Used on OB / L4D engine */
    28.7 -	if (g_ModVersion > SOURCE_SDK_EPISODE1)
    28.8 +	if (g_ModVersion != Engine_SourceSDK2006)
    28.9  	{
   28.10  		SetClientInfo(target, "name", g_NewName[target]);
   28.11  	}
    29.1 --- a/plugins/reservedslots.sp	Mon Jul 29 10:03:18 2013 -0400
    29.2 +++ b/plugins/reservedslots.sp	Sun Jul 21 11:53:56 2013 -0400
    29.3 @@ -55,7 +55,7 @@
    29.4  new Handle:sm_reserve_maxadmins;
    29.5  new Handle:sm_reserve_kicktype;
    29.6  
    29.7 -new g_SDKVersion;
    29.8 +new bool:g_BotsSubtractFromMax;
    29.9  new g_SourceTV = -1;
   29.10  new g_Replay = -1;
   29.11  
   29.12 @@ -80,9 +80,10 @@
   29.13  	HookConVarChange(sm_reserved_slots, SlotCountChanged);
   29.14  	HookConVarChange(sm_hide_slots, SlotHideChanged);
   29.15  	
   29.16 -	g_SDKVersion = GuessSDKVersion();
   29.17 +	new EngineVersion:engineVersion = GetEngineVersion();
   29.18 +	g_BotsSubtractFromMax = engineVersion == Engine_TF2 || engineVersion == Engine_CSS || engineVersion == Engine_DODS || engineVersion == Engine_HL2DM;
   29.19  	
   29.20 -	if (g_SDKVersion == SOURCE_SDK_EPISODE2VALVE)
   29.21 +	if (g_BotsSubtractFromMax)
   29.22  	{
   29.23  		for (new i = 1; i <= MaxClients; i++)
   29.24  		{
   29.25 @@ -142,7 +143,7 @@
   29.26  
   29.27  public OnClientPostAdminCheck(client)
   29.28  {
   29.29 -	if (g_SDKVersion == SOURCE_SDK_EPISODE2VALVE)
   29.30 +	if (g_BotsSubtractFromMax)
   29.31  	{
   29.32  		if (IsClientSourceTV(client))
   29.33  		{
   29.34 @@ -234,7 +235,7 @@
   29.35  
   29.36  public OnClientDisconnect_Post(client)
   29.37  {
   29.38 -	if (g_SDKVersion == SOURCE_SDK_EPISODE2VALVE)
   29.39 +	if (g_BotsSubtractFromMax)
   29.40  	{
   29.41  		if (client == g_SourceTV)
   29.42  		{
   29.43 @@ -296,7 +297,7 @@
   29.44  		num = limit;
   29.45  	}
   29.46  	
   29.47 -	if (g_SDKVersion == SOURCE_SDK_EPISODE2VALVE)
   29.48 +	if (g_BotsSubtractFromMax)
   29.49  	{
   29.50  		if (g_SourceTV > -1)
   29.51  		{
    30.1 --- a/plugins/testsuite/cstrike-test.sp	Mon Jul 29 10:03:18 2013 -0400
    30.2 +++ b/plugins/testsuite/cstrike-test.sp	Sun Jul 21 11:53:56 2013 -0400
    30.3 @@ -37,7 +37,7 @@
    30.4  
    30.5  public Action:get_score( client, argc )
    30.6  {
    30.7 -	if( GuessSDKVersion() != SOURCE_SDK_CSGO )
    30.8 +	if( GetEngineVersion() != Engine_CSGO )
    30.9  	{
   30.10  		ReplyToCommand( client, "This command is only intended for CS:GO" );
   30.11  		return Plugin_Handled;
   30.12 @@ -50,7 +50,7 @@
   30.13  
   30.14  public Action:set_score( client, argc )
   30.15  {
   30.16 -	if( GuessSDKVersion() != SOURCE_SDK_CSGO )
   30.17 +	if( GetEngineVersion() != Engine_CSGO )
   30.18  	{
   30.19  		ReplyToCommand( client, "This command is only intended for CS:GO" );
   30.20  		return Plugin_Handled;
   30.21 @@ -66,7 +66,7 @@
   30.22  
   30.23  public Action:get_assists( client, argc )
   30.24  {
   30.25 -	if( GuessSDKVersion() != SOURCE_SDK_CSGO )
   30.26 +	if( GetEngineVersion() != Engine_CSGO )
   30.27  	{
   30.28  		ReplyToCommand( client, "This command is only intended for CS:GO" );
   30.29  		return Plugin_Handled;
   30.30 @@ -79,7 +79,7 @@
   30.31  
   30.32  public Action:set_assists( client, argc )
   30.33  {
   30.34 -	if( GuessSDKVersion() != SOURCE_SDK_CSGO )
   30.35 +	if( GetEngineVersion() != Engine_CSGO )
   30.36  	{
   30.37  		ReplyToCommand( client, "This command is only intended for CS:GO" );
   30.38  		return Plugin_Handled;
    31.1 --- a/public/sm_platform.h	Mon Jul 29 10:03:18 2013 -0400
    31.2 +++ b/public/sm_platform.h	Sun Jul 21 11:53:56 2013 -0400
    31.3 @@ -91,5 +91,9 @@
    31.4  #define SOURCEMOD_BUILD
    31.5  #endif
    31.6  
    31.7 +#if !defined SM_ARRAYSIZE
    31.8 +#define SM_ARRAYSIZE(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
    31.9 +#endif
   31.10 +
   31.11  #endif //_INCLUDE_SOURCEMOD_PLATFORM_H_
   31.12  
    32.1 --- a/tools/buildbot/PackageScript	Mon Jul 29 10:03:18 2013 -0400
    32.2 +++ b/tools/buildbot/PackageScript	Sun Jul 21 11:53:56 2013 -0400
    32.3 @@ -240,8 +240,8 @@
    32.4  if 'csgo' in SM.sdkInfo:
    32.5  	AddNormalLibrary('game.cstrike.ext.2.csgo', 'extensions')
    32.6  
    32.7 -if 'ep2v' in SM.sdkInfo:
    32.8 -	AddNormalLibrary('game.tf2.ext.2.ep2v', 'extensions')
    32.9 +if 'tf2' in SM.sdkInfo:
   32.10 +	AddNormalLibrary('game.tf2.ext.2.tf2', 'extensions')
   32.11  
   32.12  AddNormalLibrary('topmenus.ext', 'extensions')
   32.13  AddNormalLibrary('regex.ext', 'extensions')