diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 5bb6b3940..41175c838 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -335,6 +335,7 @@ GAMEHOOK_REGISTRY(CSGameRules_SendDeathMessage); GAMEHOOK_REGISTRY(CBasePlayer_PlayerDeathThink); GAMEHOOK_REGISTRY(CBasePlayer_Observer_Think); +GAMEHOOK_REGISTRY(CBasePlayer_RemoveAllItems); 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 0548a841f..2635be5b9 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -745,6 +745,10 @@ typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBase typedef IHookChainClassImpl CReGameHook_CBasePlayer_Observer_Think; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Observer_Think; +// CBasePlayer::RemoveAllItems hook +typedef IHookChainClassImpl CReGameHook_CBasePlayer_RemoveAllItems; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_RemoveAllItems; + class CReGameHookchains: public IReGameHookchains { public: // CBasePlayer virtual @@ -905,6 +909,7 @@ class CReGameHookchains: public IReGameHookchains { CReGameHookRegistry_CBasePlayer_PlayerDeathThink m_CBasePlayer_PlayerDeathThink; CReGameHookRegistry_CBasePlayer_Observer_Think m_CBasePlayer_Observer_Think; + CReGameHookRegistry_CBasePlayer_RemoveAllItems m_CBasePlayer_RemoveAllItems; public: virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn(); @@ -1064,6 +1069,7 @@ class CReGameHookchains: public IReGameHookchains { virtual IReGameHookRegistry_CBasePlayer_PlayerDeathThink *CBasePlayer_PlayerDeathThink(); virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think(); + virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems(); }; extern CReGameHookchains g_ReGameHookchains; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 0e400bc51..875f085bb 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1733,7 +1733,9 @@ void EXT_FUNC CBasePlayer::__API_HOOK(GiveDefaultItems)() #endif } -void CBasePlayer::RemoveAllItems(BOOL removeSuit) +LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, RemoveAllItems, (BOOL removeSuit), removeSuit) + +void EXT_FUNC CBasePlayer::__API_HOOK(RemoveAllItems)(BOOL removeSuit) { int i; diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 8908e44c9..ced1fe973 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -448,6 +448,7 @@ class CBasePlayer: public CBaseMonster { edict_t *EntSelectSpawnPoint_OrigFunc(); void PlayerDeathThink_OrigFunc(); void Observer_Think_OrigFunc(); + void RemoveAllItems_OrigFunc(BOOL removeSuit); CCSPlayer *CSPlayer() const; #endif // REGAMEDLL_API diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 4aeb12545..8009c14ed 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -624,6 +624,10 @@ typedef IHookChainRegistryClass IReGameHookRegistry_CBa typedef IHookChainClass IReGameHook_CBasePlayer_Observer_Think; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_Think; +// CBasePlayer::RemoveAllItems hook +typedef IHookChainClass IReGameHook_CBasePlayer_RemoveAllItems; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RemoveAllItems; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -785,6 +789,7 @@ class IReGameHookchains { virtual IReGameHookRegistry_CBasePlayer_PlayerDeathThink *CBasePlayer_PlayerDeathThink() = 0; virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think() = 0; + virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems() = 0; }; struct ReGameFuncs_t {