diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 4208c0b9c..292d0b454 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -209,6 +209,7 @@ GAMEHOOK_REGISTRY(CBasePlayer_DeathSound); GAMEHOOK_REGISTRY(CBasePlayer_JoiningThink); GAMEHOOK_REGISTRY(FreeGameRules); +GAMEHOOK_REGISTRY(PM_LadderMove); 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 b430f50c5..5c7169ae0 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -357,6 +357,10 @@ typedef IHookChainRegistryImpl CReGameHookRegi typedef IHookChainImpl CReGameHook_PM_AirMove; typedef IHookChainRegistryImpl CReGameHookRegistry_PM_AirMove; +// PM_LadderMove hook +typedef IHookChainImpl CReGameHook_PM_LadderMove; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_LadderMove; + // HandleMenu_ChooseAppearance hook typedef IHookChainImpl CReGameHook_HandleMenu_ChooseAppearance; typedef IHookChainRegistryImpl CReGameHookRegistry_HandleMenu_ChooseAppearance; @@ -777,6 +781,8 @@ class CReGameHookchains: public IReGameHookchains { CReGameHookRegistry_CBasePlayer_Pain m_CBasePlayer_Pain; CReGameHookRegistry_CBasePlayer_DeathSound m_CBasePlayer_DeathSound; CReGameHookRegistry_CBasePlayer_JoiningThink m_CBasePlayer_JoiningThink; + + CReGameHookRegistry_PM_LadderMove m_PM_LadderMove; CReGameHookRegistry_FreeGameRules m_FreeGameRules; @@ -912,6 +918,7 @@ class CReGameHookchains: public IReGameHookchains { virtual IReGameHookRegistry_CBasePlayer_JoiningThink *CBasePlayer_JoiningThink(); virtual IReGameHookRegistry_FreeGameRules *FreeGameRules(); + virtual IReGameHookRegistry_PM_LadderMove *PM_LadderMove(); }; extern CReGameHookchains g_ReGameHookchains; diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index 75d4a4909..b3b57fa5d 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -1967,7 +1967,9 @@ void PM_Duck() } } -void PM_LadderMove(physent_t *pLadder) +LINK_HOOK_VOID_CHAIN(PM_LadderMove, (physent_t *pLadder), pLadder); + +void EXT_FUNC __API_HOOK(PM_LadderMove)(physent_t *pLadder) { vec3_t ladderCenter; trace_t trace; diff --git a/regamedll/pm_shared/pm_shared.h b/regamedll/pm_shared/pm_shared.h index 94113ae0a..da15fb5b0 100644 --- a/regamedll/pm_shared/pm_shared.h +++ b/regamedll/pm_shared/pm_shared.h @@ -77,12 +77,14 @@ void PM_Init(struct playermove_s *ppmove); void PM_Move(struct playermove_s *ppmove, int server); char PM_FindTextureType(char *name); void PM_AirMove_internal(); +void PM_LadderMove(physent_t *pLadder); #ifdef REGAMEDLL_API void PM_Init_OrigFunc(struct playermove_s *ppmove); void PM_Move_OrigFunc(struct playermove_s *ppmove, int server); void PM_AirMove_OrigFunc(int playerIndex = 0); void PM_UpdateStepSound_OrigFunc(); +void PM_LadderMove_OrigFunc(physent_t *pLadder); #else void PM_AirMove(int playerIndex = 0); #endif diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 493736ca2..43b7825aa 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -236,6 +236,10 @@ typedef IHookChainRegistry IReGameHookRegistry typedef IHookChain IReGameHook_PM_AirMove; typedef IHookChainRegistry IReGameHookRegistry_PM_AirMove; +// PM_LadderMove hook +typedef IHookChain IReGameHook_PM_LadderMove; +typedef IHookChainRegistry IReGameHookRegistry_PM_LadderMove; + // HandleMenu_ChooseAppearance hook typedef IHookChain IReGameHook_HandleMenu_ChooseAppearance; typedef IHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseAppearance; @@ -659,6 +663,7 @@ class IReGameHookchains { virtual IReGameHookRegistry_CBasePlayer_JoiningThink *CBasePlayer_JoiningThink() = 0; virtual IReGameHookRegistry_FreeGameRules *FreeGameRules() = 0; + virtual IReGameHookRegistry_PM_LadderMove *PM_LadderMove() = 0; }; struct ReGameFuncs_t {