Skip to content

Commit

Permalink
Revert "Implement CBasePlayer::Observer_FindNextPlayer() hook (#667)"
Browse files Browse the repository at this point in the history
This reverts commit 326cfbb.
  • Loading branch information
SergeyShorokhov authored Aug 31, 2021
1 parent 8093d31 commit 138e6f8
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 16 deletions.
1 change: 0 additions & 1 deletion regamedll/dlls/API/CAPI_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ GAMEHOOK_REGISTRY(CBasePlayer_RoundRespawn);
GAMEHOOK_REGISTRY(CBasePlayer_Blind);

GAMEHOOK_REGISTRY(CBasePlayer_Observer_IsValidTarget);
GAMEHOOK_REGISTRY(CBasePlayer_Observer_FindNextPlayer);
GAMEHOOK_REGISTRY(CBasePlayer_SetAnimation);
GAMEHOOK_REGISTRY(CBasePlayer_GiveDefaultItems);
GAMEHOOK_REGISTRY(CBasePlayer_GiveNamedItem);
Expand Down
6 changes: 0 additions & 6 deletions regamedll/dlls/API/CAPI_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ typedef IHookChainRegistryClassImpl<void, CBasePlayer, float, float, float, int>
typedef IHookChainClassImpl<CBasePlayer *, CBasePlayer, int, bool> CReGameHook_CBasePlayer_Observer_IsValidTarget;
typedef IHookChainRegistryClassImpl<CBasePlayer *, CBasePlayer, int, bool> CReGameHookRegistry_CBasePlayer_Observer_IsValidTarget;

// CBasePlayer::Observer_FindNextPlayer hook
typedef IHookChainClassImpl<void, CBasePlayer, bool, const char *> CReGameHook_CBasePlayer_Observer_FindNextPlayer;
typedef IHookChainRegistryClassImpl<void, CBasePlayer, bool, const char *> CReGameHookRegistry_CBasePlayer_Observer_FindNextPlayer;

// CBasePlayer::SetAnimation hook
typedef IHookChainClassImpl<void, CBasePlayer, PLAYER_ANIM> CReGameHook_CBasePlayer_SetAnimation;
typedef IHookChainRegistryClassImpl<void, CBasePlayer, PLAYER_ANIM> CReGameHookRegistry_CBasePlayer_SetAnimation;
Expand Down Expand Up @@ -668,7 +664,6 @@ class CReGameHookchains: public IReGameHookchains {
CReGameHookRegistry_CBasePlayer_Blind m_CBasePlayer_Blind;

CReGameHookRegistry_CBasePlayer_Observer_IsValidTarget m_CBasePlayer_Observer_IsValidTarget;
CReGameHookRegistry_CBasePlayer_Observer_FindNextPlayer m_CBasePlayer_Observer_FindNextPlayer;
CReGameHookRegistry_CBasePlayer_SetAnimation m_CBasePlayer_SetAnimation;
CReGameHookRegistry_CBasePlayer_GiveDefaultItems m_CBasePlayer_GiveDefaultItems;
CReGameHookRegistry_CBasePlayer_GiveNamedItem m_CBasePlayer_GiveNamedItem;
Expand Down Expand Up @@ -799,7 +794,6 @@ class CReGameHookchains: public IReGameHookchains {
virtual IReGameHookRegistry_CBasePlayer_Blind *CBasePlayer_Blind();

virtual IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget *CBasePlayer_Observer_IsValidTarget();
virtual IReGameHookRegistry_CBasePlayer_Observer_FindNextPlayer *CBasePlayer_Observer_FindNextPlayer();
virtual IReGameHookRegistry_CBasePlayer_SetAnimation *CBasePlayer_SetAnimation();
virtual IReGameHookRegistry_CBasePlayer_GiveDefaultItems *CBasePlayer_GiveDefaultItems();
virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem *CBasePlayer_GiveNamedItem();
Expand Down
4 changes: 1 addition & 3 deletions regamedll/dlls/observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,8 @@ void UpdateClientEffects(CBasePlayer *pObserver, int oldMode)
}
}

LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, Observer_FindNextPlayer, (bool bReverse, const char *name), bReverse, name)

// Find the next client in the game for this player to spectate
void CBasePlayer::__API_HOOK(Observer_FindNextPlayer)(bool bReverse, const char *name)
void CBasePlayer::Observer_FindNextPlayer(bool bReverse, const char *name)
{
int iStart;
int iCurrent;
Expand Down
1 change: 0 additions & 1 deletion regamedll/dlls/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ class CBasePlayer: public CBaseMonster {
void RoundRespawn_OrigFunc();
void Blind_OrigFunc(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha);
EXT_FUNC CBasePlayer *Observer_IsValidTarget_OrigFunc(int iPlayerIndex, bool bSameTeam);
EXT_FUNC void Observer_FindNextPlayer_OrigFunc(bool bReverse, const char* name = nullptr);
void Radio_OrigFunc(const char *msg_id, const char *msg_verbose = nullptr, short pitch = 100, bool showIcon = true);
void AddAccount_OrigFunc(int amount, RewardType type = RT_NONE, bool bTrackChange = true);
void Disappear_OrigFunc();
Expand Down
5 changes: 0 additions & 5 deletions regamedll/public/regamedll/regamedll_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ typedef IHookChainRegistryClass<void, class CBasePlayer, float, float, float, in
typedef IHookChainClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHook_CBasePlayer_Observer_IsValidTarget;
typedef IHookChainRegistryClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget;

// CBasePlayer::Observer_FindNextPlayer hook
typedef IHookChainClass<void, class CBasePlayer, bool, const char *> IReGameHook_CBasePlayer_Observer_FindNextPlayer;
typedef IHookChainRegistryClass<void, class CBasePlayer, bool, const char *> IReGameHookRegistry_CBasePlayer_Observer_FindNextPlayer;

// CBasePlayer::SetAnimation hook
typedef IHookChainClass<void, class CBasePlayer, PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation;
typedef IHookChainRegistryClass<void, class CBasePlayer, PLAYER_ANIM> IReGameHookRegistry_CBasePlayer_SetAnimation;
Expand Down Expand Up @@ -549,7 +545,6 @@ class IReGameHookchains {
virtual IReGameHookRegistry_CBasePlayer_Blind *CBasePlayer_Blind() = 0;

virtual IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget *CBasePlayer_Observer_IsValidTarget() = 0;
virtual IReGameHookRegistry_CBasePlayer_Observer_FindNextPlayer *CBasePlayer_Observer_FindNextPlayer() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetAnimation *CBasePlayer_SetAnimation() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveDefaultItems *CBasePlayer_GiveDefaultItems() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem *CBasePlayer_GiveNamedItem() = 0;
Expand Down

0 comments on commit 138e6f8

Please sign in to comment.