diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 87c17589e..38966f4bd 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -326,6 +326,7 @@ GAMEHOOK_REGISTRY(CSGameRules_PlayerGotWeapon); GAMEHOOK_REGISTRY(CBotManager_OnEvent); GAMEHOOK_REGISTRY(CBasePlayer_CheckTimeBasedDamage); GAMEHOOK_REGISTRY(CBasePlayer_EntSelectSpawnPoint); +GAMEHOOK_REGISTRY(CBasePlayerWeapon_ItemPostFrame); GAMEHOOK_REGISTRY(CBasePlayerWeapon_KickBack); GAMEHOOK_REGISTRY(CBasePlayerWeapon_SendWeaponAnim); diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index da62d48ac..1364c8d85 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -713,6 +713,10 @@ typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBase typedef IHookChainClassImpl CReGameHook_CBasePlayer_EntSelectSpawnPoint; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; +// CBasePlayerWeapon::ItemPostFrame hook +typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_ItemPostFrame; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame; + // CBasePlayerWeapon::KickBack hook typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_KickBack; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayerWeapon_KickBack; @@ -872,6 +876,7 @@ class CReGameHookchains: public IReGameHookchains { CReGameHookRegistry_CBotManager_OnEvent m_CBotManager_OnEvent; CReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage m_CBasePlayer_CheckTimeBasedDamage; CReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint m_CBasePlayer_EntSelectSpawnPoint; + CReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame m_CBasePlayerWeapon_ItemPostFrame; CReGameHookRegistry_CBasePlayerWeapon_KickBack m_CBasePlayerWeapon_KickBack; CReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim m_CBasePlayerWeapon_SendWeaponAnim; @@ -1024,6 +1029,7 @@ class CReGameHookchains: public IReGameHookchains { virtual IReGameHookRegistry_CBotManager_OnEvent *CBotManager_OnEvent(); virtual IReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage *CBasePlayer_CheckTimeBasedDamage(); virtual IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint *CBasePlayer_EntSelectSpawnPoint(); + virtual IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame *CBasePlayerWeapon_ItemPostFrame(); virtual IReGameHookRegistry_CBasePlayerWeapon_KickBack *CBasePlayerWeapon_KickBack(); virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim(); }; diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index a9469311a..977fdbc1a 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -896,7 +896,9 @@ void CBasePlayerWeapon::HandleInfiniteAmmo() } } -void CBasePlayerWeapon::ItemPostFrame() +LINK_HOOK_CLASS_VOID_CHAIN2(ItemPostFrame) + +void EXT_FUNC CBasePlayerWeapon::__API_HOOK(ItemPostFrame)() { int usableButtons = m_pPlayer->pev->button; diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index fb9117732..251b17dcd 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -405,6 +405,7 @@ class CBasePlayerWeapon: public CBasePlayerItem bool DefaultShotgunReload_OrigFunc(int iAnim, int iStartAnim, float fDelay, float fStartDelay, const char *pszReloadSound1, const char *pszReloadSound2); void KickBack_OrigFunc(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change); void SendWeaponAnim_OrigFunc(int iAnim, int skiplocal); + void ItemPostFrame_OrigFunc(); CCSPlayerWeapon *CSPlayerWeapon() const; #endif diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 5d1fc3436..3fd8c5960 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -592,6 +592,10 @@ typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlay typedef IHookChainClass IReGameHook_CBasePlayer_EntSelectSpawnPoint; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; +// CBasePlayerWeapon::ItemPostFrame hook +typedef IHookChainClass IReGameHook_CBasePlayerWeapon_ItemPostFrame; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame; + // CBasePlayerWeapon::KickBack hook typedef IHookChainClass IReGameHook_CBasePlayerWeapon_KickBack; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_KickBack; @@ -752,6 +756,7 @@ class IReGameHookchains { virtual IReGameHookRegistry_CBotManager_OnEvent *CBotManager_OnEvent() = 0; virtual IReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage *CBasePlayer_CheckTimeBasedDamage() = 0; virtual IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint *CBasePlayer_EntSelectSpawnPoint() = 0; + virtual IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame *CBasePlayerWeapon_ItemPostFrame() = 0; virtual IReGameHookRegistry_CBasePlayerWeapon_KickBack *CBasePlayerWeapon_KickBack() = 0; virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim() = 0; };