mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Implement RG_CBasePlayer_UseEmpty hook (#405)
* Implement to RG_CBasePlayer_UseEmpty
This commit is contained in:
parent
371ac897bb
commit
77305688a9
@ -1,3 +1,3 @@
|
||||
majorVersion=5
|
||||
minorVersion=9
|
||||
minorVersion=10
|
||||
maintenanceVersion=0
|
||||
|
@ -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;
|
||||
|
@ -537,6 +537,10 @@ typedef IHookChainRegistryImpl<bool, Vector &, Vector &, entvars_t *, edict_t *>
|
||||
typedef IHookChainClassImpl<bool, CBasePlayer, const char *, float, bool, bool> CReGameHook_CBasePlayer_HintMessageEx;
|
||||
typedef IHookChainRegistryClassImpl<bool, CBasePlayer, const char *, float, bool, bool> CReGameHookRegistry_CBasePlayer_HintMessageEx;
|
||||
|
||||
// CBasePlayer::UseEmpty hook
|
||||
typedef IHookChainClassImpl<void, CBasePlayer> CReGameHook_CBasePlayer_UseEmpty;
|
||||
typedef IHookChainRegistryClassImpl<void, CBasePlayer> 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;
|
||||
|
@ -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)
|
||||
|
@ -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<typename T = CBasePlayerItem, typename Functor>
|
||||
|
@ -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);
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include <API/CSInterfaces.h>
|
||||
|
||||
#define REGAMEDLL_API_VERSION_MAJOR 5
|
||||
#define REGAMEDLL_API_VERSION_MINOR 9
|
||||
#define REGAMEDLL_API_VERSION_MINOR 10
|
||||
|
||||
// CBasePlayer::Spawn hook
|
||||
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
|
||||
@ -440,6 +440,10 @@ typedef IHookChainRegistry<bool, Vector &, Vector &, entvars_t *, edict_t *> IRe
|
||||
typedef IHookChainClass<bool, class CBasePlayer, const char *, float, bool, bool> IReGameHook_CBasePlayer_HintMessageEx;
|
||||
typedef IHookChainRegistryClass<bool, class CBasePlayer, const char *, float, bool, bool> IReGameHookRegistry_CBasePlayer_HintMessageEx;
|
||||
|
||||
// CBasePlayer::UseEmpty hook
|
||||
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_UseEmpty;
|
||||
typedef IHookChainRegistryClass<void, class CBasePlayer> 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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user