diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 9251fe3e..59f619cc 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -186,6 +186,8 @@ GAMEHOOK_REGISTRY(CBaseEntity_FireBullets); GAMEHOOK_REGISTRY(CBaseEntity_FireBuckshots); GAMEHOOK_REGISTRY(CBaseEntity_FireBullets3); +GAMEHOOK_REGISTRY(CBasePlayer_Observer_SetMode); + GAMEHOOK_REGISTRY(CBasePlayer_Pain); GAMEHOOK_REGISTRY(CBasePlayer_DeathSound); GAMEHOOK_REGISTRY(CBasePlayer_JoiningThink); diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index 8ff309bb..65d0c023 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -621,6 +621,10 @@ typedef IHookChainRegistryClassImpl CReGameHook_CBaseEntity_FireBullets3; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBaseEntity_FireBullets3; +// CBasePlayer::Observer_SetMode hook +typedef IHookChainClassImpl CReGameHook_CBasePlayer_Observer_SetMode; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Observer_SetMode; + // CBasePlayer::Pain hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_Pain; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_Pain; @@ -758,7 +762,9 @@ public: CReGameHookRegistry_CBaseEntity_FireBullets m_CBaseEntity_FireBullets; CReGameHookRegistry_CBaseEntity_FireBuckshots m_CBaseEntity_FireBuckshots; CReGameHookRegistry_CBaseEntity_FireBullets3 m_CBaseEntity_FireBullets3; - + + CReGameHookRegistry_CBasePlayer_Observer_SetMode m_CBasePlayer_Observer_SetMode; + CReGameHookRegistry_CBasePlayer_Pain m_CBasePlayer_Pain; CReGameHookRegistry_CBasePlayer_DeathSound m_CBasePlayer_DeathSound; CReGameHookRegistry_CBasePlayer_JoiningThink m_CBasePlayer_JoiningThink; @@ -886,7 +892,9 @@ public: virtual IReGameHookRegistry_CBaseEntity_FireBullets *CBaseEntity_FireBullets(); virtual IReGameHookRegistry_CBaseEntity_FireBuckshots *CBaseEntity_FireBuckshots(); virtual IReGameHookRegistry_CBaseEntity_FireBullets3 *CBaseEntity_FireBullets3(); - + + virtual IReGameHookRegistry_CBasePlayer_Observer_SetMode *CBasePlayer_Observer_SetMode(); + virtual IReGameHookRegistry_CBasePlayer_Pain *CBasePlayer_Pain(); virtual IReGameHookRegistry_CBasePlayer_DeathSound *CBasePlayer_DeathSound(); virtual IReGameHookRegistry_CBasePlayer_JoiningThink *CBasePlayer_JoiningThink(); diff --git a/regamedll/dlls/observer.cpp b/regamedll/dlls/observer.cpp index b00aae43..8ecc3968 100644 --- a/regamedll/dlls/observer.cpp +++ b/regamedll/dlls/observer.cpp @@ -443,7 +443,9 @@ void CBasePlayer::Observer_CheckProperties() } // Attempt to change the observer mode -void CBasePlayer::Observer_SetMode(int iMode) +LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, Observer_SetMode, (int iMode), iMode) + +void EXT_FUNC CBasePlayer::__API_HOOK(Observer_SetMode)(int iMode) { int forcecamera; int oldMode; diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 76a9c207..57e012eb 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -439,6 +439,7 @@ public: bool HintMessageEx_OrigFunc(const char *pMessage, float duration = 6.0f, bool bDisplayIfPlayerDead = false, bool bOverride = false); void UseEmpty_OrigFunc(); void DropIdlePlayer_OrigFunc(const char *reason); + void Observer_SetMode_OrigFunc(int iMode); void Pain_OrigFunc(int iLastHitGroup, bool bHasArmour); void DeathSound_OrigFunc(); void JoiningThink_OrigFunc(); diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 541c32fa..c4d947ff 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -500,6 +500,10 @@ typedef IHookChainRegistryClass IReGameHook_CBaseEntity_FireBullets3; typedef IHookChainRegistryClass IReGameHookRegistry_CBaseEntity_FireBullets3; +// CBasePlayer::Observer_SetMode hook +typedef IHookChainClass IReGameHook_CBasePlayer_Observer_SetMode; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_SetMode; + // CBasePlayer::Pain hook typedef IHookChainClass IReGameHook_CBasePlayer_Pain; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Pain; @@ -638,7 +642,9 @@ public: virtual IReGameHookRegistry_CBaseEntity_FireBullets *CBaseEntity_FireBullets() = 0; virtual IReGameHookRegistry_CBaseEntity_FireBuckshots *CBaseEntity_FireBuckshots() = 0; virtual IReGameHookRegistry_CBaseEntity_FireBullets3 *CBaseEntity_FireBullets3() = 0; - + + virtual IReGameHookRegistry_CBasePlayer_Observer_SetMode *CBasePlayer_Observer_SetMode() = 0; + virtual IReGameHookRegistry_CBasePlayer_Pain *CBasePlayer_Pain() = 0; virtual IReGameHookRegistry_CBasePlayer_DeathSound *CBasePlayer_DeathSound() = 0; virtual IReGameHookRegistry_CBasePlayer_JoiningThink *CBasePlayer_JoiningThink() = 0;