diff --git a/AMBuildScript b/AMBuildScript index 042bba2d..199c6f06 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -38,48 +38,51 @@ class SM: self.possibleSdks['ep2'] = {'sdk': 'HL2SDKOB', 'ext': '2.ep2', 'def': '3', 'name': 'ORANGEBOX', 'platform': ['windows', 'linux'], 'dir': 'hl2sdk-ob'} - self.possibleSdks['css'] = {'sdk': 'HL2SDKCSS', 'ext': '2.css', 'def': '6', + self.possibleSdks['css'] = {'sdk': 'HL2SDKCSS', 'ext': '2.css', 'def': '6', 'name': 'CSS', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-css'} - self.possibleSdks['hl2dm'] = {'sdk': 'HL2SDKHL2DM', 'ext': '2.hl2dm', 'def': '7', + self.possibleSdks['hl2dm'] = {'sdk': 'HL2SDKHL2DM', 'ext': '2.hl2dm', 'def': '7', 'name': 'HL2DM', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-hl2dm'} - self.possibleSdks['dods'] = {'sdk': 'HL2SDKDODS', 'ext': '2.dods', 'def': '8', + self.possibleSdks['dods'] = {'sdk': 'HL2SDKDODS', 'ext': '2.dods', 'def': '8', 'name': 'DODS', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-dods'} - self.possibleSdks['tf2'] = {'sdk': 'HL2SDKTF2', 'ext': '2.tf2', 'def': '9', + self.possibleSdks['sdk2013'] = {'sdk': 'HL2SDK2013', 'ext': '2.sdk2013', 'def': '9', + 'name': 'SDK2013', 'platform': ['windows', 'linux', 'darwin'], + 'dir': 'hl2sdk-2013'} + self.possibleSdks['tf2'] = {'sdk': 'HL2SDKTF2', 'ext': '2.tf2', 'def': '10', 'name': 'TF2', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-tf2'} - self.possibleSdks['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '10', + self.possibleSdks['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '11', 'name': 'LEFT4DEAD', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-l4d'} - self.possibleSdks['nd'] = {'sdk': 'HL2SDKND', 'ext': '2.nd', 'def': '11', + self.possibleSdks['nd'] = {'sdk': 'HL2SDKND', 'ext': '2.nd', 'def': '12', 'name': 'NUCLEARDAWN', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-nd'} - self.possibleSdks['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '12', + self.possibleSdks['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '13', 'name': 'LEFT4DEAD2', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-l4d2'} - self.possibleSdks['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2', + self.possibleSdks['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2', 'name': 'DARKMESSIAH', 'platform': ['windows'], 'dir': 'hl2sdk-darkm'} - self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM', 'ext': '2.swarm', 'def': '13', + self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM', 'ext': '2.swarm', 'def': '14', 'name': 'ALIENSWARM', 'platform': ['windows'], 'dir': 'hl2sdk-swarm'} - self.possibleSdks['bgt'] = {'sdk': 'HL2SDK-BGT', 'ext': '2.bgt', 'def': '4', + self.possibleSdks['bgt'] = {'sdk': 'HL2SDK-BGT', 'ext': '2.bgt', 'def': '4', 'name': 'BLOODYGOODTIME', 'platform': ['windows'], 'dir': 'hl2sdk-bgt'} - self.possibleSdks['eye'] = {'sdk': 'HL2SDK-EYE', 'ext': '2.eye', 'def': '5', + self.possibleSdks['eye'] = {'sdk': 'HL2SDK-EYE', 'ext': '2.eye', 'def': '5', 'name': 'EYE', 'platform': ['windows'], 'dir': 'hl2sdk-eye'} - self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '15', + self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '16', 'name': 'CSGO', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-csgo'} - self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '16', + self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '17', 'name': 'DOTA', 'platform': ['windows'], 'dir': 'hl2sdk-dota'} - # self.possibleSdks['portal2'] = {'sdk': 'HL2SDK-PORTAL2', 'ext': '2.portal2', 'def': '14', - # 'name': 'PORTAL2', 'platform': ['windows'], - # 'dir': 'hl2sdk-portal2'} + self.possibleSdks['portal2'] = {'sdk': 'HL2SDKPORTAL2','ext': '2.portal2', 'def': '15', + 'name': 'PORTAL2', 'platform': [], + 'dir': 'hl2sdk-portal2'} self.sdkInfo = { } @@ -322,42 +325,38 @@ class SM: if AMBuild.target['platform'] == 'linux': if sdk == 'ep1': staticLibs = os.path.join(sdkPath, 'linux_sdk') + elif sdk == 'sdk2013': + staticLibs = os.path.join(sdkPath, 'lib', 'public', 'linux32') else: staticLibs = os.path.join(sdkPath, 'lib', 'linux') workFolder = os.path.join(AMBuild.outputFolder, job.workFolder) + libs = [] if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'l4d2']: libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib_srv.so', 'libtier0_srv.so'] - for lib in libs: - link = os.path.join(workFolder, lib) - target = os.path.join(staticLibs, lib) - try: - os.lstat(link) - except: - job.AddCommand(SymlinkCommand(link, target)) elif sdk in ['l4d', 'nd', 'csgo']: libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so'] if sdk == 'csgo': libs.append('interfaces_i486.a') - for lib in libs: - link = os.path.join(workFolder, lib) - target = os.path.join(staticLibs, lib) - try: - os.lstat(link) - except: - job.AddCommand(SymlinkCommand(link, target)) + elif sdk == 'sdk2013': + libs = ['tier1.a', 'mathlib.a', 'libvstdlib_srv.so', 'libtier0_srv.so'] else: libs = ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so'] - for lib in libs: - link = os.path.join(workFolder, lib) - target = os.path.join(staticLibs, lib) - try: - os.lstat(link) - except: - job.AddCommand(SymlinkCommand(link, target)) + + for lib in libs: + link = os.path.join(workFolder, lib) + target = os.path.join(staticLibs, lib) + try: + os.lstat(link) + except: + job.AddCommand(SymlinkCommand(link, target)) elif AMBuild.target['platform'] == 'darwin': - staticLibs = os.path.join(sdkPath, 'lib', 'mac') + if sdk == 'sdk2013': + staticLibs = os.path.join(sdkPath, 'lib', 'public', 'osx32') + libs = ['tier1.a', 'mathlib.a', 'libvstdlib.dylib', 'libtier0.dylib'] + else: + staticLibs = os.path.join(sdkPath, 'lib', 'mac') + libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.dylib', 'libtier0.dylib'] workFolder = os.path.join(AMBuild.outputFolder, job.workFolder) - libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.dylib', 'libtier0.dylib'] if sdk == 'csgo': libs.append('interfaces_i486.a') for lib in libs: @@ -378,7 +377,11 @@ class SM: def PostSetupHL2Job(self, job, builder, sdk): if AMBuild.target['platform'] in ['linux', 'darwin']: - builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a']) + if sdk == 'sdk2013': + builder.AddObjectFiles(['tier1.a', 'mathlib.a']) + else: + builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a']) + if sdk == 'csgo': builder.AddObjectFiles(['interfaces_i486.a']) @@ -394,10 +397,6 @@ class SM: info = self.possibleSdks compiler['CDEFINES'].extend(['SE_' + info[i]['name'] + '=' + info[i]['def'] for i in info]) - - # We don't build for Portal 2 (yet?, ever?), but using this define in code as - # it saves trouble if we ever need to - compiler['CDEFINES'].append('SE_PORTAL2=14') paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'], ['public', 'tier0'], ['public', 'tier1']] @@ -414,6 +413,13 @@ class SM: sdkPath = AMBuild.cache[info['sdk']] compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def']) + + if sdk == 'sdk2013' and isinstance(compiler.cxx, Cpp.CompatGCC): + # The 2013 SDK already has these in public/tier0/basetypes.h + compiler['CDEFINES'].remove('stricmp=strcasecmp') + compiler['CDEFINES'].remove('_stricmp=strcasecmp') + compiler['CDEFINES'].remove('_snprintf=snprintf') + compiler['CDEFINES'].remove('_vsnprintf=vsnprintf') if sdk in ['swarm','csgo','dota']: if AMBuild.target['platform'] == 'windows': @@ -421,13 +427,24 @@ class SM: else: compiler['CDEFINES'].extend(['COMPILER_GCC']) - if sdk == 'ep1': - if AMBuild.target['platform'] == 'linux': + if sdk == 'sdk2013' and AMBuild.target['platform'] == 'darwin': + compiler['POSTLINKFLAGS'].append('-liconv') + + if sdk in ['css','hl2dm','dods','sdk2013','tf2','l4d2']: + if AMBuild.target['platform'] == 'linux' or AMBuild.target['platform'] == 'darwin': + compiler['CDEFINES'].append('NO_MALLOC_OVERRIDE') + + if AMBuild.target['platform'] == 'linux': + if sdk == 'ep1': staticLibs = os.path.join(sdkPath, 'linux_sdk') - else: - if AMBuild.target['platform'] == 'linux': + elif sdk == 'sdk2013': + staticLibs = os.path.join(sdkPath, 'lib', 'public', 'linux32') + else: staticLibs = os.path.join(sdkPath, 'lib', 'linux') - elif AMBuild.target['platform'] == 'darwin': + elif AMBuild.target['platform'] == 'darwin': + if sdk == 'sdk2013': + staticLibs = os.path.join(sdkPath, 'lib', 'public', 'osx32') + else: staticLibs = os.path.join(sdkPath, 'lib', 'mac') for i in paths: @@ -436,7 +453,7 @@ class SM: if not noLink: if AMBuild.target['platform'] == 'linux': compiler['POSTLINKFLAGS'][0:0] = ['-lm'] - if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'l4d2']: + if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'l4d2']: compiler['POSTLINKFLAGS'][0:0] = ['libtier0_srv.so'] compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib_srv.so'] elif sdk in ['l4d', 'nd', 'csgo']: diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index 831bc6fa..7a091d24 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -58,7 +58,7 @@ typedef ICommandLine *(*FakeGetCommandLine)(); #define TIER0_NAME "libtier0.dylib" #define VSTDLIB_NAME "libvstdlib.dylib" #elif defined __linux__ -#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_LEFT4DEAD2 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_LEFT4DEAD2 #define TIER0_NAME "libtier0_srv.so" #define VSTDLIB_NAME "libvstdlib_srv.so" #elif SOURCE_ENGINE >= SE_LEFT4DEAD diff --git a/core/MenuStyle_Base.cpp b/core/MenuStyle_Base.cpp index 6f348453..c6ea1934 100644 --- a/core/MenuStyle_Base.cpp +++ b/core/MenuStyle_Base.cpp @@ -338,7 +338,7 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press) #endif 0, PITCH_NORM, -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 0, #endif &pos); diff --git a/core/logic_bridge.cpp b/core/logic_bridge.cpp index 0b883080..00048b71 100644 --- a/core/logic_bridge.cpp +++ b/core/logic_bridge.cpp @@ -219,6 +219,8 @@ static const char *get_source_engine_name() return "hl2dm"; #elif SOURCE_ENGINE == SE_DODS return "dods"; +#elif SOURCE_ENGINE == SE_SDK2013 + return "sdk2013"; #elif SOURCE_ENGINE == SE_TF2 return "tf2"; #elif SOURCE_ENGINE == SE_LEFT4DEAD @@ -240,7 +242,16 @@ static const char *get_source_engine_name() static bool symbols_are_hidden() { -#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) +#if (SOURCE_ENGINE == SE_CSS) \ + || (SOURCE_ENGINE == SE_HL2DM) \ + || (SOURCE_ENGINE == SE_DODS) \ + || (SOURCE_ENGINE == SE_SDK2013) \ + || (SOURCE_ENGINE == SE_TF2) \ + || (SOURCE_ENGINE == SE_LEFT4DEAD) \ + || (SOURCE_ENGINE == SE_NUCLEARDAWN) \ + || (SOURCE_ENGINE == SE_LEFT4DEAD2) \ + || (SOURCE_ENGINE == SE_CSGO) \ + || (SOURCE_ENGINE == SE_DOTA) return true; #else return false; @@ -345,6 +356,8 @@ void do_global_plugin_loads() #define GAMEFIX "2.hl2dm" #elif SOURCE_ENGINE == SE_DODS #define GAMEFIX "2.dods" +#elif SOURCE_ENGINE == SE_SDK2013 +#define GAMEFIX "2.sdk2013" #elif SOURCE_ENGINE == SE_TF2 #define GAMEFIX "2.tf2" #elif SOURCE_ENGINE == SE_DARKMESSIAH diff --git a/core/smn_entities.cpp b/core/smn_entities.cpp index b2aeb894..9ffc0047 100644 --- a/core/smn_entities.cpp +++ b/core/smn_entities.cpp @@ -1254,7 +1254,7 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params) is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED); // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 if (pProp->GetFlags() & SPROP_VARINT) { bit_count = sizeof(int) * 8; @@ -1352,7 +1352,7 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params) FIND_PROP_SEND(DPT_Int, "integer"); // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 if (pProp->GetFlags() & SPROP_VARINT) { bit_count = sizeof(int) * 8; @@ -2074,7 +2074,7 @@ static int32_t SDKEntFlagToSMEntFlag(int flag) #if SOURCE_ENGINE == SE_ALIENSWARM case FL_FREEZING: return ENTFLAG_FREEZING; -#elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 +#elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 case FL_EP2V_UNKNOWN: return ENTFLAG_EP2V_UNKNOWN1; #endif @@ -2152,7 +2152,7 @@ static int32_t SMEntFlagToSDKEntFlag(int32_t flag) #if SOURCE_ENGINE == SE_ALIENSWARM case ENTFLAG_FREEZING: return FL_FREEZING; -#elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 +#elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 case ENTFLAG_EP2V_UNKNOWN1: return FL_EP2V_UNKNOWN; #endif diff --git a/core/smn_halflife.cpp b/core/smn_halflife.cpp index 165eb676..a8a51120 100644 --- a/core/smn_halflife.cpp +++ b/core/smn_halflife.cpp @@ -497,6 +497,7 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params) case SOURCE_ENGINE_HL2DM: case SOURCE_ENGINE_DODS: case SOURCE_ENGINE_TF2: + case SOURCE_ENGINE_SDK2013: return 35; case SOURCE_ENGINE_LEFT4DEAD: return 40; diff --git a/extensions/sdktools/hooks.cpp b/extensions/sdktools/hooks.cpp index 81ea3ea3..e4042bc4 100644 --- a/extensions/sdktools/hooks.cpp +++ b/extensions/sdktools/hooks.cpp @@ -32,6 +32,12 @@ #include "hooks.h" #include "extension.h" +#include "basehandle.h" +#include "vector.h" +#include "utlvector.h" +#include +#include "usercmd.h" + #define FEATURECAP_PLAYERRUNCMD_11PARAMS "SDKTools PlayerRunCmd 11Params" CHookManager g_Hooks; diff --git a/extensions/sdktools/hooks.h b/extensions/sdktools/hooks.h index a7ffa759..6452a4da 100644 --- a/extensions/sdktools/hooks.h +++ b/extensions/sdktools/hooks.h @@ -32,12 +32,8 @@ #ifndef _INCLUDE_HOOKS_H_ #define _INCLUDE_HOOKS_H_ -#include "basehandle.h" -#undef ARRAYSIZE -#include "vector.h" -#include "utlvector.h" -#include -#include "usercmd.h" +class CUserCmd; + #include "extension.h" class CHookManager : IPluginsListener, IFeatureProvider diff --git a/extensions/sdktools/vcaller.cpp b/extensions/sdktools/vcaller.cpp index d6bc1c41..642520ed 100644 --- a/extensions/sdktools/vcaller.cpp +++ b/extensions/sdktools/vcaller.cpp @@ -129,7 +129,15 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p { return 0; } -#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) +#if SOURCE_ENGINE == SE_CSS \ + || SOURCE_ENGINE == SE_HL2DM \ + || SOURCE_ENGINE == SE_DODS \ + || SOURCE_ENGINE == SE_SDK2013 \ + || SOURCE_ENGINE == SE_TF2 \ + || SOURCE_ENGINE == SE_LEFT4DEAD \ + || SOURCE_ENGINE == SE_LEFT4DEAD2 \ + || SOURCE_ENGINE == SE_NUCLEARDAWN \ + || SOURCE_ENGINE == SE_CSGO s_call_addr = memutils->ResolveSymbol(handle, &sig[1]); #else s_call_addr = dlsym(handle, &sig[1]); diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index 07e817ad..fbddec86 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -566,7 +566,7 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params) CellRecipientFilter rf; rf.SetToReliable(true); rf.Initialize(player_list, total_players); -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, 0, &pos); #elif SOURCE_ENGINE < SE_PORTAL2 engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, &pos); diff --git a/extensions/sdktools/vsound.cpp b/extensions/sdktools/vsound.cpp index 4b503791..1753ef22 100644 --- a/extensions/sdktools/vsound.cpp +++ b/extensions/sdktools/vsound.cpp @@ -41,7 +41,7 @@ SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const #if SOURCE_ENGINE >= SE_PORTAL2 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 *, bool, float, int); 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 *, bool, float, int); -#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 0, IRecipientFilter &, int, int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector *, bool, float, int); 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 *, bool, float, int); #else @@ -288,7 +288,7 @@ int SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChanne float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, const Vector *pDirection, CUtlVector *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity) -#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample, float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, const Vector *pDirection, CUtlVector *pUtlVecOrigins, bool bUpdatePositions, @@ -349,7 +349,7 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann (crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, iSoundlevel, nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity) ); -#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 RETURN_META_NEWPARAMS( MRES_IGNORED, static_cast *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity) -#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample, float flVolume, float flAttenuation, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, const Vector *pDirection, CUtlVector *pUtlVecOrigins, bool bUpdatePositions, @@ -442,7 +442,7 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan (crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, SNDLVL_TO_ATTN(static_cast(sndlevel)), nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity) ); -#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 RETURN_META_NEWPARAMS( MRES_IGNORED, static_cast *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity); #else -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 void OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, @@ -86,7 +86,7 @@ public: float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin, const Vector *pDirection, CUtlVector *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity); -#endif // SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 +#endif // SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 #endif // SOURCE_ENGINE >= SE_PORTAL2 private: size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter); diff --git a/loader/loader.cpp b/loader/loader.cpp index 8b9a0906..2ef99be4 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -80,6 +80,7 @@ #define FILENAME_1_6_CSS "sourcemod.2.css" PLATFORM_EXT #define FILENAME_1_6_HL2DM "sourcemod.2.hl2dm" PLATFORM_EXT #define FILENAME_1_6_DODS "sourcemod.2.dods" PLATFORM_EXT +#define FILENAME_1_6_SDK2013 "sourcemod.2.sdk2013" PLATFORM_EXT #define FILENAME_1_6_TF2 "sourcemod.2.tf2" PLATFORM_EXT #define FILENAME_1_6_ND "sourcemod.2.nd" PLATFORM_EXT #define FILENAME_1_6_DOTA "sourcemod.2.dota" PLATFORM_EXT @@ -297,6 +298,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co filename = FILENAME_1_6_DODS; break; } + case SOURCE_ENGINE_SDK2013: + { + filename = FILENAME_1_6_SDK2013; + break; + } case SOURCE_ENGINE_TF2: { filename = FILENAME_1_6_TF2; diff --git a/plugins/include/halflife.inc b/plugins/include/halflife.inc index a48dc488..6191d88f 100644 --- a/plugins/include/halflife.inc +++ b/plugins/include/halflife.inc @@ -83,7 +83,8 @@ enum EngineVersion Engine_HL2DM, /**< Half-Life 2 Deathmatch */ Engine_DODS, /**< Day of Defeat: Source */ Engine_TF2, /**< Team Fortress 2 */ - Engine_NuclearDawn /**< Nuclear Dawn */ + Engine_NuclearDawn, /**< Nuclear Dawn */ + Engine_SDK2013, /**< Source SDK 2013 */ }; #define INVALID_ENT_REFERENCE 0xFFFFFFFF