Added api hook CWeaponBox::Touch, CArmoury::Touch

This commit is contained in:
s1lentq 2016-06-20 17:50:59 +07:00
parent a1e7b9dae5
commit 2d69db1232
6 changed files with 69 additions and 31 deletions

View File

@ -1637,9 +1637,11 @@ void CWeaponBox::Kill()
UTIL_Remove(this);
}
LINK_HOOK_CLASS_VOID_CHAIN(CWeaponBox, Touch, (CBaseEntity *pOther), pOther);
// CWeaponBox - Touch: try to add my contents to the toucher
// if the toucher is a player.
void CWeaponBox::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
void CWeaponBox::__API_VHOOK(Touch)(CBaseEntity *pOther)
{
if (!(pev->flags & FL_ONGROUND))
{
@ -2143,7 +2145,9 @@ struct ArmouryItemStruct
{ "weapon_m249", "556NatoBox", 60, MAX_AMMO_556NATOBOX }, // ARMOURY_M249
};
void CArmoury::ArmouryTouch(CBaseEntity *pOther)
LINK_HOOK_CLASS_VOID_CHAIN(CArmoury, ArmouryTouch, (CBaseEntity *pOther), pOther);
void CArmoury::__API_HOOK(ArmouryTouch)(CBaseEntity *pOther)
{
if (!pOther->IsPlayer())
return;

View File

@ -148,6 +148,7 @@ public:
public:
void EXPORT ArmouryTouch(CBaseEntity *pOther);
void ArmouryTouch_(CBaseEntity *pOther);
public:
int m_iItem;
@ -472,7 +473,7 @@ public:
virtual void SetObjectCollisionBox();
virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
#if defined(REGAMEDLL_API) || defined(HOOK_GAMEDLL)
void Spawn_();
void Precache_();

View File

@ -157,10 +157,22 @@ typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHo
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName;
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoName;
// CBasePlayer::DropPlayerItem hook
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
// CBaseAnimating::ResetSequenceInfo hook
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
// CWeaponBox::Touch hook
typedef IVoidHookChainClass<class CWeaponBox, class CBaseEntity*> IReGameHook_CWeaponBox_Touch;
typedef IVoidHookChainRegistryClass<class CWeaponBox, class CBaseEntity*> IReGameHookRegistry_CWeaponBox_Touch;
// CArmoury::Touch hook
typedef IVoidHookChainClass<class CArmoury, class CBaseEntity*> IReGameHook_CArmoury_Touch;
typedef IVoidHookChainRegistryClass<class CArmoury, class CBaseEntity*> IReGameHookRegistry_CArmoury_Touch;
// GetForceCamera hook
typedef IHookChain<int, class CBasePlayer *> IReGameHook_GetForceCamera;
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_GetForceCamera;
@ -181,6 +193,10 @@ typedef IHookChainRegistry<bool, int, ScenarioEventEndRound, float> IReGameHookR
typedef IHookChain<bool, class CBasePlayer *, int> IReGameHook_CanBuyThis;
typedef IHookChainRegistry<bool, class CBasePlayer *, int> IReGameHookRegistry_CanBuyThis;
// CanBuyThisItem hook
typedef IHookChain<bool, class CBasePlayer *, BuyItemID> IReGameHook_CanBuyThisItem;
typedef IHookChainRegistry<bool, class CBasePlayer *, BuyItemID> IReGameHookRegistry_CanBuyThisItem;
// InstallGameRules hook
typedef IHookChain<class CGameRules *> IReGameHook_InstallGameRules;
typedef IHookChainRegistry<class CGameRules *> IReGameHookRegistry_InstallGameRules;
@ -301,14 +317,6 @@ typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GoToIntermissio
typedef IVoidHookChain<> IReGameHook_CSGameRules_BalanceTeams;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams;
// CanBuyThisItem hook
typedef IHookChain<bool, class CBasePlayer *, BuyItemID> IReGameHook_CanBuyThisItem;
typedef IHookChainRegistry<bool, class CBasePlayer *, BuyItemID> IReGameHookRegistry_CanBuyThisItem;
// CBasePlayer::DropPlayerItem hook
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
class IReGameHookchains {
public:
virtual ~IReGameHookchains() {}
@ -385,6 +393,8 @@ public:
virtual IReGameHookRegistry_CanBuyThisItem* CanBuyThisItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem* CBasePlayer_DropPlayerItem() = 0;
virtual IReGameHookRegistry_CWeaponBox_Touch* CWeaponBox_Touch() = 0;
virtual IReGameHookRegistry_CArmoury_Touch* CArmoury_Touch() = 0;
};
struct ReGameFuncs_t {

View File

@ -157,10 +157,22 @@ typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHo
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName;
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoName;
// CBasePlayer::DropPlayerItem hook
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
// CBaseAnimating::ResetSequenceInfo hook
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
// CWeaponBox::Touch hook
typedef IVoidHookChainClass<class CWeaponBox, class CBaseEntity*> IReGameHook_CWeaponBox_Touch;
typedef IVoidHookChainRegistryClass<class CWeaponBox, class CBaseEntity*> IReGameHookRegistry_CWeaponBox_Touch;
// CArmoury::Touch hook
typedef IVoidHookChainClass<class CArmoury, class CBaseEntity*> IReGameHook_CArmoury_Touch;
typedef IVoidHookChainRegistryClass<class CArmoury, class CBaseEntity*> IReGameHookRegistry_CArmoury_Touch;
// GetForceCamera hook
typedef IHookChain<int, class CBasePlayer *> IReGameHook_GetForceCamera;
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_GetForceCamera;
@ -181,6 +193,10 @@ typedef IHookChainRegistry<bool, int, ScenarioEventEndRound, float> IReGameHookR
typedef IHookChain<bool, class CBasePlayer *, int> IReGameHook_CanBuyThis;
typedef IHookChainRegistry<bool, class CBasePlayer *, int> IReGameHookRegistry_CanBuyThis;
// CanBuyThisItem hook
typedef IHookChain<bool, class CBasePlayer *, BuyItemID> IReGameHook_CanBuyThisItem;
typedef IHookChainRegistry<bool, class CBasePlayer *, BuyItemID> IReGameHookRegistry_CanBuyThisItem;
// InstallGameRules hook
typedef IHookChain<class CGameRules *> IReGameHook_InstallGameRules;
typedef IHookChainRegistry<class CGameRules *> IReGameHookRegistry_InstallGameRules;
@ -301,14 +317,6 @@ typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GoToIntermissio
typedef IVoidHookChain<> IReGameHook_CSGameRules_BalanceTeams;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams;
// CanBuyThisItem hook
typedef IHookChain<bool, class CBasePlayer *, BuyItemID> IReGameHook_CanBuyThisItem;
typedef IHookChainRegistry<bool, class CBasePlayer *, BuyItemID> IReGameHookRegistry_CanBuyThisItem;
// CBasePlayer::DropPlayerItem hook
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
class IReGameHookchains {
public:
virtual ~IReGameHookchains() {}
@ -385,6 +393,8 @@ public:
virtual IReGameHookRegistry_CanBuyThisItem* CanBuyThisItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem* CBasePlayer_DropPlayerItem() = 0;
virtual IReGameHookRegistry_CWeaponBox_Touch* CWeaponBox_Touch() = 0;
virtual IReGameHookRegistry_CArmoury_Touch* CArmoury_Touch() = 0;
};
struct ReGameFuncs_t {

View File

@ -75,13 +75,18 @@ IReGameHookRegistry_CBasePlayer_AddAccount* CReGameHookchains::CBasePlayer_AddAc
IReGameHookRegistry_CBasePlayer_GiveShield* CReGameHookchains::CBasePlayer_GiveShield() { return &m_CBasePlayer_GiveShield; }
IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CReGameHookchains::CBasePlayer_SetClientUserInfoModel() { return &m_CBasePlayer_SetClientUserInfoModel; }
IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CReGameHookchains::CBasePlayer_SetClientUserInfoName() { return &m_CBasePlayer_SetClientUserInfoName; }
IReGameHookRegistry_CBasePlayer_DropPlayerItem* CReGameHookchains::CBasePlayer_DropPlayerItem() { return &m_CBasePlayer_DropPlayerItem; }
IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CReGameHookchains::CBaseAnimating_ResetSequenceInfo() { return &m_CBaseAnimating_ResetSequenceInfo; }
IReGameHookRegistry_CWeaponBox_Touch* CReGameHookchains::CWeaponBox_Touch() { return &m_CWeaponBox_Touch; }
IReGameHookRegistry_CArmoury_Touch* CReGameHookchains::CArmoury_Touch() { return &m_CArmoury_ArmouryTouch; }
IReGameHookRegistry_GetForceCamera* CReGameHookchains::GetForceCamera() { return &m_GetForceCamera; }
IReGameHookRegistry_PlayerBlind* CReGameHookchains::PlayerBlind() { return &m_PlayerBlind; }
IReGameHookRegistry_RadiusFlash_TraceLine* CReGameHookchains::RadiusFlash_TraceLine() { return &m_RadiusFlash_TraceLine; }
IReGameHookRegistry_RoundEnd* CReGameHookchains::RoundEnd() { return &m_RoundEnd; }
IReGameHookRegistry_CanBuyThis* CReGameHookchains::CanBuyThis() { return &m_CanBuyThis; }
IReGameHookRegistry_CanBuyThisItem* CReGameHookchains::CanBuyThisItem() { return &m_CanBuyThisItem; }
IReGameHookRegistry_InstallGameRules* CReGameHookchains::InstallGameRules() { return &m_InstallGameRules; }
IReGameHookRegistry_PM_Init* CReGameHookchains::PM_Init() { return &m_PM_Init; }
IReGameHookRegistry_PM_Move* CReGameHookchains::PM_Move() { return &m_PM_Move; }
@ -114,9 +119,6 @@ IReGameHookRegistry_CSGameRules_ChangeLevel* CReGameHookchains::CSGameRules_Chan
IReGameHookRegistry_CSGameRules_GoToIntermission* CReGameHookchains::CSGameRules_GoToIntermission() { return &m_CSGameRules_GoToIntermission; }
IReGameHookRegistry_CSGameRules_BalanceTeams* CReGameHookchains::CSGameRules_BalanceTeams() { return &m_CSGameRules_BalanceTeams; }
IReGameHookRegistry_CanBuyThisItem* CReGameHookchains::CanBuyThisItem() { return &m_CanBuyThisItem; }
IReGameHookRegistry_CBasePlayer_DropPlayerItem* CReGameHookchains::CBasePlayer_DropPlayerItem() { return &m_CBasePlayer_DropPlayerItem; }
int CReGameApi::GetMajorVersion()
{
return REGAMEDLL_API_VERSION_MAJOR;

View File

@ -119,7 +119,6 @@ typedef IVoidHookChainRegistryClassImpl<CBasePlayer> CReGameHookRegistry_CBasePl
typedef IVoidHookChainClassImpl<CBasePlayer, float, float, float, int> CReGameHook_CBasePlayer_Blind;
typedef IVoidHookChainRegistryClassImpl<CBasePlayer, float, float, float, int> CReGameHookRegistry_CBasePlayer_Blind;
// CBasePlayer::Observer_IsValidTarget hook
typedef IHookChainClassImpl<CBasePlayer *, CBasePlayer, int, bool> CReGameHook_CBasePlayer_Observer_IsValidTarget;
typedef IHookChainRegistryClassImpl<CBasePlayer *, CBasePlayer, int, bool> CReGameHookRegistry_CBasePlayer_Observer_IsValidTarget;
@ -152,10 +151,22 @@ typedef IVoidHookChainRegistryClassImpl<CBasePlayer, char *, char *> CReGameHook
typedef IVoidHookChainClassImpl<CBasePlayer, char *, char *> CReGameHook_CBasePlayer_SetClientUserInfoName;
typedef IVoidHookChainRegistryClassImpl<CBasePlayer, char *, char *> CReGameHookRegistry_CBasePlayer_SetClientUserInfoName;
// CBasePlayer::DropPlayerItem hook
typedef IVoidHookChainClassImpl<CBasePlayer, const char *> CReGameHook_CBasePlayer_DropPlayerItem;
typedef IVoidHookChainRegistryClassImpl<CBasePlayer, const char *> CReGameHookRegistry_CBasePlayer_DropPlayerItem;
// CBaseAnimating::ResetSequenceInfo hook
typedef IVoidHookChainClassImpl<CBaseAnimating> CReGameHook_CBaseAnimating_ResetSequenceInfo;
typedef IVoidHookChainRegistryClassImpl<CBaseAnimating> CReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
// CWeaponBox::Touch hook
typedef IVoidHookChainClassImpl<CWeaponBox, CBaseEntity*> CReGameHook_CWeaponBox_Touch;
typedef IVoidHookChainRegistryClassImpl<CWeaponBox, CBaseEntity*> CReGameHookRegistry_CWeaponBox_Touch;
// CArmoury::Touch hook
typedef IVoidHookChainClassImpl<CArmoury, CBaseEntity*> CReGameHook_CArmoury_Touch;
typedef IVoidHookChainRegistryClassImpl<CArmoury, CBaseEntity*> CReGameHookRegistry_CArmoury_Touch;
// GetForceCamera hook
typedef IHookChainImpl<int, class CBasePlayer *> CReGameHook_GetForceCamera;
typedef IHookChainRegistryImpl<int, class CBasePlayer *> CReGameHookRegistry_GetForceCamera;
@ -176,6 +187,10 @@ typedef IHookChainRegistryClassEmptyImpl<bool, class CHalfLifeMultiplay, int, Sc
typedef IHookChainImpl<bool, class CBasePlayer *, int> CReGameHook_CanBuyThis;
typedef IHookChainRegistryImpl<bool, class CBasePlayer *, int> CReGameHookRegistry_CanBuyThis;
// CanBuyThisItem hook
typedef IHookChainImpl<bool, class CBasePlayer *, BuyItemID> CReGameHook_CanBuyThisItem;
typedef IHookChainRegistryImpl<bool, class CBasePlayer *, BuyItemID> CReGameHookRegistry_CanBuyThisItem;
// InstallGameRules hook
typedef IHookChainImpl<CGameRules *> CReGameHook_InstallGameRules;
typedef IHookChainRegistryImpl<CGameRules *> CReGameHookRegistry_InstallGameRules;
@ -296,14 +311,6 @@ typedef IVoidHookChainRegistryClassEmptyImpl<class CHalfLifeMultiplay> CReGameHo
typedef IVoidHookChainClassImpl<class CHalfLifeMultiplay> CReGameHook_CSGameRules_BalanceTeams;
typedef IVoidHookChainRegistryClassEmptyImpl<class CHalfLifeMultiplay> CReGameHookRegistry_CSGameRules_BalanceTeams;
// CanBuyThisItem hook
typedef IHookChainImpl<bool, class CBasePlayer *, BuyItemID> CReGameHook_CanBuyThisItem;
typedef IHookChainRegistryImpl<bool, class CBasePlayer *, BuyItemID> CReGameHookRegistry_CanBuyThisItem;
// CBasePlayer::DropPlayerItem hook
typedef IVoidHookChainClassImpl<CBasePlayer, const char *> CReGameHook_CBasePlayer_DropPlayerItem;
typedef IVoidHookChainRegistryClassImpl<CBasePlayer, const char *> CReGameHookRegistry_CBasePlayer_DropPlayerItem;
class CReGameHookchains: public IReGameHookchains {
public:
// CBasePlayer virtual
@ -379,6 +386,8 @@ public:
CReGameHookRegistry_CanBuyThisItem m_CanBuyThisItem;
CReGameHookRegistry_CBasePlayer_DropPlayerItem m_CBasePlayer_DropPlayerItem;
CReGameHookRegistry_CWeaponBox_Touch m_CWeaponBox_Touch;
CReGameHookRegistry_CArmoury_Touch m_CArmoury_ArmouryTouch;
public:
virtual IReGameHookRegistry_CBasePlayer_Spawn* CBasePlayer_Spawn();
@ -453,6 +462,8 @@ public:
virtual IReGameHookRegistry_CanBuyThisItem* CanBuyThisItem();
virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem* CBasePlayer_DropPlayerItem();
virtual IReGameHookRegistry_CWeaponBox_Touch* CWeaponBox_Touch();
virtual IReGameHookRegistry_CArmoury_Touch* CArmoury_Touch();
};
extern CReGameHookchains g_ReGameHookchains;