Fix SDKHooks TraceAttack hook crashing on SDK 2013 mods.
authorNicholas Hastings <skamonkey@gmail.com>
Sat Mar 08 22:06:29 2014 -0500 (2014-03-08)
changeset 4281bd29e1e631e0
parent 4280 a513e4e14614
child 4282 6ca985b00ca1
Fix SDKHooks TraceAttack hook crashing on SDK 2013 mods.
extensions/sdkhooks/extension.cpp
extensions/sdkhooks/extension.h
     1.1 --- a/extensions/sdkhooks/extension.cpp	Sat Mar 08 19:50:55 2014 -0700
     1.2 +++ b/extensions/sdkhooks/extension.cpp	Sat Mar 08 22:06:29 2014 -0500
     1.3 @@ -175,8 +175,8 @@
     1.4  SH_DECL_MANUALHOOK1_void(StartTouch, 0, 0, 0, CBaseEntity *);
     1.5  SH_DECL_MANUALHOOK0_void(Think, 0, 0, 0);
     1.6  SH_DECL_MANUALHOOK1_void(Touch, 0, 0, 0, CBaseEntity *);
     1.7 -#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
     1.8 -SH_DECL_MANUALHOOK4_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *, void *);
     1.9 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_SDK2013
    1.10 +SH_DECL_MANUALHOOK4_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *, CDmgAccumulator *);
    1.11  #else
    1.12  SH_DECL_MANUALHOOK3_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *);
    1.13  #endif
    1.14 @@ -1292,8 +1292,8 @@
    1.15  	RETURN_META(MRES_IGNORED);
    1.16  }
    1.17  
    1.18 -#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
    1.19 -void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK)
    1.20 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_SDK2013
    1.21 +void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator)
    1.22  #else
    1.23  void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr)
    1.24  #endif
    1.25 @@ -1357,8 +1357,8 @@
    1.26  	RETURN_META(MRES_IGNORED);
    1.27  }
    1.28  
    1.29 -#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
    1.30 -void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK)
    1.31 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_SDK2013
    1.32 +void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator)
    1.33  #else
    1.34  void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr)
    1.35  #endif
     2.1 --- a/extensions/sdkhooks/extension.h	Sat Mar 08 19:50:55 2014 -0700
     2.2 +++ b/extensions/sdkhooks/extension.h	Sat Mar 08 22:06:29 2014 -0500
     2.3 @@ -101,7 +101,9 @@
     2.4  /**
     2.5   * Classes
     2.6   */
     2.7 +
     2.8  class IPhysicsObject;
     2.9 +class CDmgAccumulator;
    2.10  typedef CBaseEntity CBaseCombatWeapon;
    2.11  
    2.12  class HookList
    2.13 @@ -283,9 +285,9 @@
    2.14  	void Hook_ThinkPost();
    2.15  	void Hook_Touch(CBaseEntity *pOther);
    2.16  	void Hook_TouchPost(CBaseEntity *pOther);
    2.17 -#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2
    2.18 -	void Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK);
    2.19 -	void Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, void *pUnknownJK);
    2.20 +#if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_SDK2013
    2.21 +	void Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator);
    2.22 +	void Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator);
    2.23  #else
    2.24  	void Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr);
    2.25  	void Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr);