diff --git a/gradle.properties b/gradle.properties index 704a66e3..2c9a9182 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ majorVersion=5 -minorVersion=9 +minorVersion=10 maintenanceVersion=0 diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 0a464b06..777454ec 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -161,6 +161,7 @@ GAMEHOOK_REGISTRY(CBasePlayer_SetSpawnProtection); GAMEHOOK_REGISTRY(CBasePlayer_RemoveSpawnProtection); GAMEHOOK_REGISTRY(IsPenetrableEntity); GAMEHOOK_REGISTRY(CBasePlayer_HintMessageEx); +GAMEHOOK_REGISTRY(CBasePlayer_UseEmpty); int CReGameApi::GetMajorVersion() { return REGAMEDLL_API_VERSION_MAJOR; diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index a4f44804..ed5e5167 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -537,6 +537,10 @@ typedef IHookChainRegistryImpl typedef IHookChainClassImpl CReGameHook_CBasePlayer_HintMessageEx; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_HintMessageEx; +// CBasePlayer::UseEmpty hook +typedef IHookChainClassImpl CReGameHook_CBasePlayer_UseEmpty; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_UseEmpty; + class CReGameHookchains: public IReGameHookchains { public: // CBasePlayer virtual @@ -645,6 +649,7 @@ public: CReGameHookRegistry_CBasePlayer_RemoveSpawnProtection m_CBasePlayer_RemoveSpawnProtection; CReGameHookRegistry_IsPenetrableEntity m_IsPenetrableEntity; CReGameHookRegistry_CBasePlayer_HintMessageEx m_CBasePlayer_HintMessageEx; + CReGameHookRegistry_CBasePlayer_UseEmpty m_CBasePlayer_UseEmpty; public: virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn(); @@ -752,6 +757,7 @@ public: virtual IReGameHookRegistry_CBasePlayer_RemoveSpawnProtection *CBasePlayer_RemoveSpawnProtection(); virtual IReGameHookRegistry_IsPenetrableEntity *IsPenetrableEntity(); virtual IReGameHookRegistry_CBasePlayer_HintMessageEx *CBasePlayer_HintMessageEx(); + virtual IReGameHookRegistry_CBasePlayer_UseEmpty *CBasePlayer_UseEmpty(); }; extern CReGameHookchains g_ReGameHookchains; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 2e01be1f..62069390 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -3922,13 +3922,19 @@ void CBasePlayer::PlayerUse() } } } - else + else if (m_afButtonPressed & IN_USE) { - if (m_afButtonPressed & IN_USE) - EMIT_SOUND(ENT(pev), CHAN_ITEM, "common/wpn_denyselect.wav", 0.4, ATTN_NORM); + UseEmpty(); } } +LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, UseEmpty) + +void EXT_FUNC CBasePlayer::__API_HOOK(UseEmpty)() +{ + EMIT_SOUND(ENT(pev), CHAN_ITEM, "common/wpn_denyselect.wav", 0.4, ATTN_NORM); +} + void CBasePlayer::HostageUsed() { if (m_flDisplayHistory & DHF_HOSTAGE_USED) diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 8b5b0a97..88b47585 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -424,6 +424,7 @@ public: void SetSpawnProtection_OrigFunc(float flProtectionTime); void RemoveSpawnProtection_OrigFunc(); bool HintMessageEx_OrigFunc(const char *pMessage, float duration = 6.0f, bool bDisplayIfPlayerDead = false, bool bOverride = false); + void UseEmpty_OrigFunc(); CCSPlayer *CSPlayer() const; #endif // REGAMEDLL_API @@ -619,6 +620,7 @@ public: void SetSpawnProtection(float flProtectionTime); void RemoveSpawnProtection(); + void UseEmpty(); // templates template diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index e615a2fe..5483907a 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -91,7 +91,7 @@ public: virtual void ResetSequenceInfo(); virtual void StartDeathCam(); virtual bool RemovePlayerItemEx(const char* pszItemName, bool bRemoveAmmo); - virtual void SetSpawnProtection(float flProtectionTime); + virtual void SetSpawnProtection(float flProtectionTime); virtual void RemoveSpawnProtection(); virtual bool HintMessageEx(const char *pMessage, float duration = 6.0f, bool bDisplayIfPlayerDead = false, bool bOverride = false); diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index cd258ab3..2616ef84 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 9 +#define REGAMEDLL_API_VERSION_MINOR 10 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; @@ -440,6 +440,10 @@ typedef IHookChainRegistry IRe typedef IHookChainClass IReGameHook_CBasePlayer_HintMessageEx; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_HintMessageEx; +// CBasePlayer::UseEmpty hook +typedef IHookChainClass IReGameHook_CBasePlayer_UseEmpty; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UseEmpty; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -549,6 +553,7 @@ public: virtual IReGameHookRegistry_CBasePlayer_SetSpawnProtection *CBasePlayer_SetSpawnProtection() = 0; virtual IReGameHookRegistry_IsPenetrableEntity *IsPenetrableEntity() = 0; virtual IReGameHookRegistry_CBasePlayer_HintMessageEx *CBasePlayer_HintMessageEx() = 0; + virtual IReGameHookRegistry_CBasePlayer_UseEmpty *CBasePlayer_UseEmpty() = 0; }; struct ReGameFuncs_t {