mirror of
https://github.com/rehlds/reapi.git
synced 2025-03-13 14:00:19 +03:00
Implement RG_CBasePlayer_DropIdlePlayer hook (#148)
* Implement RG_CBasePlayer_DropIdlePlayer hook
This commit is contained in:
parent
9874820989
commit
d954d042f1
@ -761,6 +761,13 @@ enum GamedllFunc_CBasePlayer
|
|||||||
* Params: (const this)
|
* Params: (const this)
|
||||||
*/
|
*/
|
||||||
RG_CBasePlayer_UseEmpty,
|
RG_CBasePlayer_UseEmpty,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Description: Called when a idle player is removed from server.
|
||||||
|
* Return type: void
|
||||||
|
* Params: (const this, const reason[])
|
||||||
|
*/
|
||||||
|
RG_CBasePlayer_DropIdlePlayer,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -460,6 +460,10 @@ typedef IHookChainRegistryClass<int, class CBasePlayerWeapon, int, int, float> I
|
|||||||
typedef IHookChainClass<bool, class CBasePlayerWeapon, int, int, float, float, const char *, const char *> IReGameHook_CBasePlayerWeapon_DefaultShotgunReload;
|
typedef IHookChainClass<bool, class CBasePlayerWeapon, int, int, float, float, const char *, const char *> IReGameHook_CBasePlayerWeapon_DefaultShotgunReload;
|
||||||
typedef IHookChainRegistryClass<bool, class CBasePlayerWeapon, int, int, float, float, const char *, const char *> IReGameHookRegistry_CBasePlayerWeapon_DefaultShotgunReload;
|
typedef IHookChainRegistryClass<bool, class CBasePlayerWeapon, int, int, float, float, const char *, const char *> IReGameHookRegistry_CBasePlayerWeapon_DefaultShotgunReload;
|
||||||
|
|
||||||
|
// CBasePlayer::DropIdlePlayer hook
|
||||||
|
typedef IHookChainClass<void, class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropIdlePlayer;
|
||||||
|
typedef IHookChainRegistryClass<void, class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropIdlePlayer;
|
||||||
|
|
||||||
class IReGameHookchains {
|
class IReGameHookchains {
|
||||||
public:
|
public:
|
||||||
virtual ~IReGameHookchains() {}
|
virtual ~IReGameHookchains() {}
|
||||||
@ -574,6 +578,7 @@ public:
|
|||||||
virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultDeploy *CBasePlayerWeapon_DefaultDeploy() = 0;
|
virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultDeploy *CBasePlayerWeapon_DefaultDeploy() = 0;
|
||||||
virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultReload *CBasePlayerWeapon_DefaultReload() = 0;
|
virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultReload *CBasePlayerWeapon_DefaultReload() = 0;
|
||||||
virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultShotgunReload *CBasePlayerWeapon_DefaultShotgunReload() = 0;
|
virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultShotgunReload *CBasePlayerWeapon_DefaultShotgunReload() = 0;
|
||||||
|
virtual IReGameHookRegistry_CBasePlayer_DropIdlePlayer *CBasePlayer_DropIdlePlayer() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ReGameFuncs_t {
|
struct ReGameFuncs_t {
|
||||||
|
@ -552,6 +552,16 @@ void CBasePlayer_UseEmpty(IReGameHook_CBasePlayer_UseEmpty *chain, CBasePlayer *
|
|||||||
callVoidForward(RG_CBasePlayer_UseEmpty, original, indexOfEdict(pthis->pev));
|
callVoidForward(RG_CBasePlayer_UseEmpty, original, indexOfEdict(pthis->pev));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CBasePlayer_DropIdlePlayer(IReGameHook_CBasePlayer_DropIdlePlayer *chain, CBasePlayer *pthis, const char *reason)
|
||||||
|
{
|
||||||
|
auto original = [chain](int _pthis, const char *_reason)
|
||||||
|
{
|
||||||
|
return chain->callNext(getPrivate<CBasePlayer>(_pthis), _reason);
|
||||||
|
};
|
||||||
|
|
||||||
|
callVoidForward(RG_CBasePlayer_DropIdlePlayer, original, indexOfEdict(pthis->pev), reason);
|
||||||
|
}
|
||||||
|
|
||||||
void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis)
|
void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis)
|
||||||
{
|
{
|
||||||
auto original = [chain](int _pthis)
|
auto original = [chain](int _pthis)
|
||||||
|
@ -389,6 +389,7 @@ void CBasePlayer_SetSpawnProtection(IReGameHook_CBasePlayer_SetSpawnProtection *
|
|||||||
void CBasePlayer_RemoveSpawnProtection(IReGameHook_CBasePlayer_RemoveSpawnProtection *chain, CBasePlayer *pthis);
|
void CBasePlayer_RemoveSpawnProtection(IReGameHook_CBasePlayer_RemoveSpawnProtection *chain, CBasePlayer *pthis);
|
||||||
bool CBasePlayer_HintMessageEx(IReGameHook_CBasePlayer_HintMessageEx *chain, CBasePlayer *pthis, const char *pMessage, float duration, bool bDisplayIfPlayerDead, bool bOverride);
|
bool CBasePlayer_HintMessageEx(IReGameHook_CBasePlayer_HintMessageEx *chain, CBasePlayer *pthis, const char *pMessage, float duration, bool bDisplayIfPlayerDead, bool bOverride);
|
||||||
void CBasePlayer_UseEmpty(IReGameHook_CBasePlayer_UseEmpty *chain, CBasePlayer *pthis);
|
void CBasePlayer_UseEmpty(IReGameHook_CBasePlayer_UseEmpty *chain, CBasePlayer *pthis);
|
||||||
|
void CBasePlayer_DropIdlePlayer(IReGameHook_CBasePlayer_DropIdlePlayer *chain, CBasePlayer *pthis, const char *reason);
|
||||||
|
|
||||||
void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis);
|
void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis);
|
||||||
|
|
||||||
|
@ -155,6 +155,7 @@ hook_t hooklist_player[] = {
|
|||||||
DLL(CBasePlayer_RemoveSpawnProtection),
|
DLL(CBasePlayer_RemoveSpawnProtection),
|
||||||
DLL(CBasePlayer_HintMessageEx),
|
DLL(CBasePlayer_HintMessageEx),
|
||||||
DLL(CBasePlayer_UseEmpty),
|
DLL(CBasePlayer_UseEmpty),
|
||||||
|
DLL(CBasePlayer_DropIdlePlayer),
|
||||||
};
|
};
|
||||||
|
|
||||||
hook_t hooklist_gamerules[] = {
|
hook_t hooklist_gamerules[] = {
|
||||||
|
@ -180,6 +180,7 @@ enum GamedllFunc_CBasePlayer
|
|||||||
RG_CBasePlayer_RemoveSpawnProtection,
|
RG_CBasePlayer_RemoveSpawnProtection,
|
||||||
RG_CBasePlayer_HintMessageEx,
|
RG_CBasePlayer_HintMessageEx,
|
||||||
RG_CBasePlayer_UseEmpty,
|
RG_CBasePlayer_UseEmpty,
|
||||||
|
RG_CBasePlayer_DropIdlePlayer,
|
||||||
|
|
||||||
// [...]
|
// [...]
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user