API: Added new API funcs (6) and new Hookchains (21) (#849)

* Added few newest API Hookchains
* Added hookchain for PM_CheckWaterJump
* Added hookchain for PM_Jump
* Added hookchain for PM_Duck
* Added hookchain for PM_UnDuck
* Added hookchain for ClearMultiDamage
* Added hookchain for AddMultiDamage
* Added hookchain for ApplyMultiDamage
* Added hookchain for CSGameRules::TeamFull
* Added hookchain for CSGameRules::TeamStacked
* Added hookchain for CSGameRules::PlayerGotWeapon
* Added hookchain for CBotManager::OnEvent
* Added hookchain for CBasePlayer::EntSelectSpawnPoint
* Added hookchain for CBasePlayerWeapon::KickBack
* Added hookchain for CBasePlayerWeapon::SendWeaponAnim
* Added new PM_* Hookchains
* Added PM_WaterJump
* Added PM_PlayStepSound
* Added PM_AirAccelerate
* Added CBasePlayer::CheckTimeBasedDamage
* Added CBasePlayerWeapon::ItemPostFrame
* Added BuyItem and CSGameRules::Think
* AddAmmoNameToAmmoRegistry refactory
* Bump minor version in an API bump up to 23
This commit is contained in:
Francisco Muñoz 2023-09-05 00:43:40 -03:00 committed by GitHub
parent f3723d7a04
commit 696f465977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 494 additions and 121 deletions

View File

@ -30,40 +30,133 @@
CReGameHookchains g_ReGameHookchains;
int EXT_FUNC Cmd_Argc_api() {
void EXT_FUNC Regamedll_ChangeString_api(char *&dest, const char *source)
{
size_t len = Q_strlen(source);
if (dest == nullptr || Q_strlen(dest) != len) {
delete [] dest;
dest = new char [len + 1];
}
Q_strcpy(dest, source);
}
void EXT_FUNC RadiusDamage_api(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType)
{
RadiusDamage(vecSrc, pevInflictor, pevAttacker, flDamage, flRadius, iClassIgnore, bitsDamageType);
}
void EXT_FUNC ClearMultiDamage_api()
{
ClearMultiDamage();
}
void EXT_FUNC ApplyMultiDamage_api(entvars_t *pevInflictor, entvars_t *pevAttacker)
{
ApplyMultiDamage(pevInflictor, pevAttacker);
}
void EXT_FUNC AddMultiDamage_api(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType)
{
AddMultiDamage(pevInflictor, pEntity, flDamage, bitsDamageType);
}
int EXT_FUNC Cmd_Argc_api()
{
return CMD_ARGC_();
}
const char *EXT_FUNC Cmd_Argv_api(int i) {
const char *EXT_FUNC Cmd_Argv_api(int i)
{
return CMD_ARGV_(i);
}
CGrenade *PlantBomb_api(entvars_t *pevOwner, Vector &vecStart, Vector &vecVelocity) {
CGrenade *EXT_FUNC PlantBomb_api(entvars_t *pevOwner, Vector &vecStart, Vector &vecVelocity)
{
return CGrenade::ShootSatchelCharge(pevOwner, vecStart, vecVelocity);
}
CGib *SpawnHeadGib_api(entvars_t *pevVictim) {
CGib *EXT_FUNC SpawnHeadGib_api(entvars_t *pevVictim)
{
return CGib::SpawnHeadGib(pevVictim);
}
void SpawnRandomGibs_api(entvars_t *pevVictim, int cGibs, int human) {
void EXT_FUNC SpawnRandomGibs_api(entvars_t *pevVictim, int cGibs, int human)
{
CGib::SpawnRandomGibs(pevVictim, cGibs, human);
}
void EXT_FUNC UTIL_RestartOther_api(const char *szClassname)
{
UTIL_RestartOther(szClassname);
}
void EXT_FUNC UTIL_ResetEntities_api()
{
UTIL_ResetEntities();
}
void EXT_FUNC UTIL_RemoveOther_api(const char *szClassname, int nCount)
{
UTIL_RemoveOther(szClassname, nCount);
}
void EXT_FUNC UTIL_DecalTrace_api(TraceResult *pTrace, int decalNumber)
{
UTIL_DecalTrace(pTrace, decalNumber);
}
void EXT_FUNC UTIL_Remove_api(CBaseEntity *pEntity)
{
UTIL_Remove(pEntity);
}
int EXT_FUNC AddAmmoNameToAmmoRegistry_api(const char *szAmmoname)
{
return AddAmmoNameToAmmoRegistry(szAmmoname);
}
void EXT_FUNC TextureTypePlaySound_api(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType)
{
TEXTURETYPE_PlaySound(ptr, vecSrc, vecEnd, iBulletType);
}
CWeaponBox *EXT_FUNC CreateWeaponBox_api(CBasePlayerItem *pItem, CBasePlayer *pPlayerOwner, const char *modelName, Vector &origin, Vector &angles, Vector &velocity, float lifeTime, bool packAmmo)
{
return CreateWeaponBox(pItem, pPlayerOwner, modelName, origin, angles, velocity, lifeTime < 0.0 ? CGameRules::GetItemKillDelay() : lifeTime, packAmmo);
}
CGrenade *EXT_FUNC SpawnGrenade_api(WeaponIdType weaponId, entvars_t *pevOwner, Vector &vecSrc, Vector &vecThrow, float time, int iTeam, unsigned short usEvent)
{
switch (weaponId)
{
case WEAPON_HEGRENADE:
return CGrenade::ShootTimed2(pevOwner, vecSrc, vecThrow, time, iTeam, usEvent);
case WEAPON_FLASHBANG:
return CGrenade::ShootTimed(pevOwner, vecSrc, vecThrow, time);
case WEAPON_SMOKEGRENADE:
return CGrenade::ShootSmokeGrenade(pevOwner, vecSrc, vecThrow, time, usEvent);
case WEAPON_C4:
return CGrenade::ShootSatchelCharge(pevOwner, vecSrc, vecThrow);
}
return nullptr;
}
ReGameFuncs_t g_ReGameApiFuncs = {
&CREATE_NAMED_ENTITY,
CREATE_NAMED_ENTITY,
&Regamedll_ChangeString_api,
Regamedll_ChangeString_api,
&RadiusDamage_api,
&ClearMultiDamage_api,
&ApplyMultiDamage_api,
&AddMultiDamage_api,
RadiusDamage_api,
ClearMultiDamage_api,
ApplyMultiDamage_api,
AddMultiDamage_api,
&UTIL_FindEntityByString,
UTIL_FindEntityByString,
&AddEntityHashValue,
&RemoveEntityHashValue,
AddEntityHashValue,
RemoveEntityHashValue,
Cmd_Argc_api,
Cmd_Argv_api,
@ -76,6 +169,13 @@ ReGameFuncs_t g_ReGameApiFuncs = {
UTIL_RestartOther_api,
UTIL_ResetEntities_api,
UTIL_RemoveOther_api,
UTIL_DecalTrace_api,
UTIL_Remove_api,
AddAmmoNameToAmmoRegistry_api,
TextureTypePlaySound_api,
CreateWeaponBox_api,
SpawnGrenade_api,
};
GAMEHOOK_REGISTRY(CBasePlayer_Spawn);
@ -210,6 +310,27 @@ GAMEHOOK_REGISTRY(CBasePlayer_JoiningThink);
GAMEHOOK_REGISTRY(FreeGameRules);
GAMEHOOK_REGISTRY(PM_LadderMove);
GAMEHOOK_REGISTRY(PM_WaterJump);
GAMEHOOK_REGISTRY(PM_CheckWaterJump);
GAMEHOOK_REGISTRY(PM_Jump);
GAMEHOOK_REGISTRY(PM_Duck);
GAMEHOOK_REGISTRY(PM_UnDuck);
GAMEHOOK_REGISTRY(PM_PlayStepSound);
GAMEHOOK_REGISTRY(PM_AirAccelerate);
GAMEHOOK_REGISTRY(ClearMultiDamage);
GAMEHOOK_REGISTRY(AddMultiDamage);
GAMEHOOK_REGISTRY(ApplyMultiDamage);
GAMEHOOK_REGISTRY(BuyItem);
GAMEHOOK_REGISTRY(CSGameRules_Think);
GAMEHOOK_REGISTRY(CSGameRules_TeamFull);
GAMEHOOK_REGISTRY(CSGameRules_TeamStacked);
GAMEHOOK_REGISTRY(CSGameRules_PlayerGotWeapon);
GAMEHOOK_REGISTRY(CBotManager_OnEvent);
GAMEHOOK_REGISTRY(CBasePlayer_CheckTimeBasedDamage);
GAMEHOOK_REGISTRY(CBasePlayer_EntSelectSpawnPoint);
GAMEHOOK_REGISTRY(CBasePlayerWeapon_ItemPostFrame);
GAMEHOOK_REGISTRY(CBasePlayerWeapon_KickBack);
GAMEHOOK_REGISTRY(CBasePlayerWeapon_SendWeaponAnim);
int CReGameApi::GetMajorVersion() {
return REGAMEDLL_API_VERSION_MAJOR;
@ -272,48 +393,4 @@ bool CReGameApi::BGetIGameRules(const char *pchVersion) const
return false;
}
EXT_FUNC void Regamedll_ChangeString_api(char *&dest, const char *source)
{
size_t len = Q_strlen(source);
if (dest == nullptr || Q_strlen(dest) != len) {
delete [] dest;
dest = new char [len + 1];
}
Q_strcpy(dest, source);
}
EXT_FUNC void RadiusDamage_api(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType)
{
RadiusDamage(vecSrc, pevInflictor, pevAttacker, flDamage, flRadius, iClassIgnore, bitsDamageType);
}
EXT_FUNC void ClearMultiDamage_api()
{
ClearMultiDamage();
}
EXT_FUNC void ApplyMultiDamage_api(entvars_t *pevInflictor, entvars_t *pevAttacker)
{
ApplyMultiDamage(pevInflictor, pevAttacker);
}
EXT_FUNC void AddMultiDamage_api(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType)
{
AddMultiDamage(pevInflictor, pEntity, flDamage, bitsDamageType);
}
EXT_FUNC void UTIL_RestartOther_api(const char *szClassname) {
UTIL_RestartOther(szClassname);
}
EXT_FUNC void UTIL_ResetEntities_api() {
UTIL_ResetEntities();
}
EXT_FUNC void UTIL_RemoveOther_api(const char *szClassname, int nCount)
{
UTIL_RemoveOther(szClassname, nCount);
}
EXPOSE_SINGLE_INTERFACE(CReGameApi, IReGameApi, VRE_GAMEDLL_API_VERSION);

View File

@ -357,10 +357,6 @@ typedef IHookChainRegistryImpl<void, struct playermove_s *, int> CReGameHookRegi
typedef IHookChainImpl<void, int> CReGameHook_PM_AirMove;
typedef IHookChainRegistryImpl<void, int> CReGameHookRegistry_PM_AirMove;
// PM_LadderMove hook
typedef IHookChainImpl<void, struct physent_s *> CReGameHook_PM_LadderMove;
typedef IHookChainRegistryImpl<void, struct physent_s *> CReGameHookRegistry_PM_LadderMove;
// HandleMenu_ChooseAppearance hook
typedef IHookChainImpl<void, CBasePlayer *, int> CReGameHook_HandleMenu_ChooseAppearance;
typedef IHookChainRegistryImpl<void, CBasePlayer *, int> CReGameHookRegistry_HandleMenu_ChooseAppearance;
@ -649,6 +645,94 @@ typedef IHookChainRegistryClassImpl<void, CBasePlayer> CReGameHookRegistry_CBase
typedef IHookChainImpl<void, CGameRules **> CReGameHook_FreeGameRules;
typedef IHookChainRegistryImpl<void, CGameRules **> CReGameHookRegistry_FreeGameRules;
// PM_LadderMove hook
typedef IHookChainImpl<void, struct physent_s *> CReGameHook_PM_LadderMove;
typedef IHookChainRegistryImpl<void, struct physent_s *> CReGameHookRegistry_PM_LadderMove;
// PM_WaterJump hook
typedef IHookChainImpl<void> CReGameHook_PM_WaterJump;
typedef IHookChainRegistryImpl<void> CReGameHookRegistry_PM_WaterJump;
// PM_CheckWaterJump hook
typedef IHookChainImpl<void> CReGameHook_PM_CheckWaterJump;
typedef IHookChainRegistryImpl<void> CReGameHookRegistry_PM_CheckWaterJump;
// PM_Jump hook
typedef IHookChainImpl<void> CReGameHook_PM_Jump;
typedef IHookChainRegistryImpl<void> CReGameHookRegistry_PM_Jump;
// PM_Duck hook
typedef IHookChainImpl<void> CReGameHook_PM_Duck;
typedef IHookChainRegistryImpl<void> CReGameHookRegistry_PM_Duck;
// PM_UnDuck hook
typedef IHookChainImpl<void> CReGameHook_PM_UnDuck;
typedef IHookChainRegistryImpl<void> CReGameHookRegistry_PM_UnDuck;
// PM_PlayStepSound hook
typedef IHookChainImpl<void, int, float> CReGameHook_PM_PlayStepSound;
typedef IHookChainRegistryImpl<void, int, float> CReGameHookRegistry_PM_PlayStepSound;
// PM_AirAccelerate hook
typedef IHookChainImpl<void, vec_t *, float, float> CReGameHook_PM_AirAccelerate;
typedef IHookChainRegistryImpl<void, vec_t *, float, float> CReGameHookRegistry_PM_AirAccelerate;
// ClearMultiDamage hook
typedef IHookChainImpl<void> CReGameHook_ClearMultiDamage;
typedef IHookChainRegistryImpl<void> CReGameHookRegistry_ClearMultiDamage;
// AddMultiDamage hook
typedef IHookChainImpl<void, entvars_t *, CBaseEntity *, float, int> CReGameHook_AddMultiDamage;
typedef IHookChainRegistryImpl<void, entvars_t *, CBaseEntity *, float, int> CReGameHookRegistry_AddMultiDamage;
// ApplyMultiDamage hook
typedef IHookChainImpl<void, entvars_t *, entvars_t *> CReGameHook_ApplyMultiDamage;
typedef IHookChainRegistryImpl<void, entvars_t *, entvars_t *> CReGameHookRegistry_ApplyMultiDamage;
// BuyItem hook
typedef IHookChainImpl<void, CBasePlayer *, int> CReGameHook_BuyItem;
typedef IHookChainRegistryImpl<void, CBasePlayer *, int> CReGameHookRegistry_BuyItem;
// CHalfLifeMultiplay::Think hook
typedef IHookChainClassImpl<void, class CHalfLifeMultiplay> CReGameHook_CSGameRules_Think;
typedef IHookChainRegistryClassEmptyImpl<void, class CHalfLifeMultiplay> CReGameHookRegistry_CSGameRules_Think;
// CHalfLifeMultiplay::TeamFull hook
typedef IHookChainClassImpl<BOOL, class CHalfLifeMultiplay, int> CReGameHook_CSGameRules_TeamFull;
typedef IHookChainRegistryClassEmptyImpl<BOOL, class CHalfLifeMultiplay, int> CReGameHookRegistry_CSGameRules_TeamFull;
// CHalfLifeMultiplay::TeamStacked hook
typedef IHookChainClassImpl<BOOL, class CHalfLifeMultiplay, int, int> CReGameHook_CSGameRules_TeamStacked;
typedef IHookChainRegistryClassEmptyImpl<BOOL, class CHalfLifeMultiplay, int, int> CReGameHookRegistry_CSGameRules_TeamStacked;
// CHalfLifeMultiplay::PlayerGotWeapon hook
typedef IHookChainClassImpl<void, class CHalfLifeMultiplay, CBasePlayer *, CBasePlayerItem *> CReGameHook_CSGameRules_PlayerGotWeapon;
typedef IHookChainRegistryClassEmptyImpl<void, class CHalfLifeMultiplay, CBasePlayer *, CBasePlayerItem *> CReGameHookRegistry_CSGameRules_PlayerGotWeapon;
// CBotManager::OnEvent hook
typedef IHookChainClassImpl<void, CBotManager, GameEventType, CBaseEntity *, CBaseEntity *> CReGameHook_CBotManager_OnEvent;
typedef IHookChainRegistryClassEmptyImpl<void, CBotManager, GameEventType, CBaseEntity*, CBaseEntity*> CReGameHookRegistry_CBotManager_OnEvent;
// CBasePlayer::CheckTimeBasedDamage hook
typedef IHookChainClassImpl<void, CBasePlayer> CReGameHook_CBasePlayer_CheckTimeBasedDamage;
typedef IHookChainRegistryClassImpl<void, CBasePlayer> CReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage;
// CBasePlayer::EntSelectSpawnPoint hook
typedef IHookChainClassImpl<edict_t *, CBasePlayer> CReGameHook_CBasePlayer_EntSelectSpawnPoint;
typedef IHookChainRegistryClassImpl<edict_t *, CBasePlayer> CReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint;
// CBasePlayerWeapon::ItemPostFrame hook
typedef IHookChainClassImpl<void, CBasePlayerWeapon> CReGameHook_CBasePlayerWeapon_ItemPostFrame;
typedef IHookChainRegistryClassImpl<void, CBasePlayerWeapon> CReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame;
// CBasePlayerWeapon::KickBack hook
typedef IHookChainClassImpl<void, CBasePlayerWeapon, float, float, float, float, float, float, int> CReGameHook_CBasePlayerWeapon_KickBack;
typedef IHookChainRegistryClassImpl<void, CBasePlayerWeapon, float, float, float, float, float, float, int> CReGameHookRegistry_CBasePlayerWeapon_KickBack;
// CBasePlayerWeapon::SendWeaponAnim hook
typedef IHookChainClassImpl<void, CBasePlayerWeapon, int, int> CReGameHook_CBasePlayerWeapon_SendWeaponAnim;
typedef IHookChainRegistryClassImpl<void, CBasePlayerWeapon, int, int> CReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim;
class CReGameHookchains: public IReGameHookchains {
public:
// CBasePlayer virtual
@ -782,9 +866,29 @@ public:
CReGameHookRegistry_CBasePlayer_DeathSound m_CBasePlayer_DeathSound;
CReGameHookRegistry_CBasePlayer_JoiningThink m_CBasePlayer_JoiningThink;
CReGameHookRegistry_PM_LadderMove m_PM_LadderMove;
CReGameHookRegistry_FreeGameRules m_FreeGameRules;
CReGameHookRegistry_PM_LadderMove m_PM_LadderMove;
CReGameHookRegistry_PM_WaterJump m_PM_WaterJump;
CReGameHookRegistry_PM_CheckWaterJump m_PM_CheckWaterJump;
CReGameHookRegistry_PM_Jump m_PM_Jump;
CReGameHookRegistry_PM_Duck m_PM_Duck;
CReGameHookRegistry_PM_UnDuck m_PM_UnDuck;
CReGameHookRegistry_PM_PlayStepSound m_PM_PlayStepSound;
CReGameHookRegistry_PM_AirAccelerate m_PM_AirAccelerate;
CReGameHookRegistry_ClearMultiDamage m_ClearMultiDamage;
CReGameHookRegistry_AddMultiDamage m_AddMultiDamage;
CReGameHookRegistry_ApplyMultiDamage m_ApplyMultiDamage;
CReGameHookRegistry_BuyItem m_BuyItem;
CReGameHookRegistry_CSGameRules_Think m_CSGameRules_Think;
CReGameHookRegistry_CSGameRules_TeamFull m_CSGameRules_TeamFull;
CReGameHookRegistry_CSGameRules_TeamStacked m_CSGameRules_TeamStacked;
CReGameHookRegistry_CSGameRules_PlayerGotWeapon m_CSGameRules_PlayerGotWeapon;
CReGameHookRegistry_CBotManager_OnEvent m_CBotManager_OnEvent;
CReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage m_CBasePlayer_CheckTimeBasedDamage;
CReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint m_CBasePlayer_EntSelectSpawnPoint;
CReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame m_CBasePlayerWeapon_ItemPostFrame;
CReGameHookRegistry_CBasePlayerWeapon_KickBack m_CBasePlayerWeapon_KickBack;
CReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim m_CBasePlayerWeapon_SendWeaponAnim;
public:
virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn();
@ -919,6 +1023,27 @@ public:
virtual IReGameHookRegistry_FreeGameRules *FreeGameRules();
virtual IReGameHookRegistry_PM_LadderMove *PM_LadderMove();
virtual IReGameHookRegistry_PM_WaterJump *PM_WaterJump();
virtual IReGameHookRegistry_PM_CheckWaterJump *PM_CheckWaterJump();
virtual IReGameHookRegistry_PM_Jump *PM_Jump();
virtual IReGameHookRegistry_PM_Duck *PM_Duck();
virtual IReGameHookRegistry_PM_UnDuck *PM_UnDuck();
virtual IReGameHookRegistry_PM_PlayStepSound *PM_PlayStepSound();
virtual IReGameHookRegistry_PM_AirAccelerate *PM_AirAccelerate();
virtual IReGameHookRegistry_ClearMultiDamage *ClearMultiDamage();
virtual IReGameHookRegistry_AddMultiDamage *AddMultiDamage();
virtual IReGameHookRegistry_ApplyMultiDamage *ApplyMultiDamage();
virtual IReGameHookRegistry_BuyItem *BuyItem();
virtual IReGameHookRegistry_CSGameRules_Think *CSGameRules_Think();
virtual IReGameHookRegistry_CSGameRules_TeamFull *CSGameRules_TeamFull();
virtual IReGameHookRegistry_CSGameRules_TeamStacked *CSGameRules_TeamStacked();
virtual IReGameHookRegistry_CSGameRules_PlayerGotWeapon *CSGameRules_PlayerGotWeapon();
virtual IReGameHookRegistry_CBotManager_OnEvent *CBotManager_OnEvent();
virtual IReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage *CBasePlayer_CheckTimeBasedDamage();
virtual IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint *CBasePlayer_EntSelectSpawnPoint();
virtual IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame *CBasePlayerWeapon_ItemPostFrame();
virtual IReGameHookRegistry_CBasePlayerWeapon_KickBack *CBasePlayerWeapon_KickBack();
virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim();
};
extern CReGameHookchains g_ReGameHookchains;
@ -945,14 +1070,3 @@ public:
EXT_FUNC virtual bool BGetICSEntity(const char *pchVersion) const;
EXT_FUNC virtual bool BGetIGameRules(const char *pchVersion) const;
};
void Regamedll_ChangeString_api(char *&dest, const char *source);
void RadiusDamage_api(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType);
void ClearMultiDamage_api();
void ApplyMultiDamage_api(entvars_t *pevInflictor, entvars_t *pevAttacker);
void AddMultiDamage_api(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
void UTIL_RestartOther_api(const char *szClassname);
void UTIL_ResetEntities_api();
void UTIL_RemoveOther_api(const char *szClassname, int nCount = 0);

View File

@ -1194,7 +1194,9 @@ void BuyMachineGun(CBasePlayer *pPlayer, int iSlot)
BuyWeaponByWeaponID(pPlayer, WEAPON_M249);
}
void BuyItem(CBasePlayer *pPlayer, int iSlot)
LINK_HOOK_VOID_CHAIN(BuyItem, (CBasePlayer *pPlayer, int iSlot), pPlayer, iSlot)
void EXT_FUNC __API_HOOK(BuyItem)(CBasePlayer *pPlayer, int iSlot)
{
int iItemPrice = 0;
const char *pszItem = nullptr;

View File

@ -112,6 +112,7 @@ extern unsigned short g_iShadowSprite;
void HandleMenu_ChooseAppearance_OrigFunc(CBasePlayer *pPlayer, int slot);
BOOL HandleMenu_ChooseTeam_OrigFunc(CBasePlayer *pPlayer, int slot);
bool BuyGunAmmo_OrigFunc(CBasePlayer *pPlayer, CBasePlayerItem *weapon, bool bBlinkMoney);
void BuyItem_OrigFunc(CBasePlayer *pPlayer, int iSlot);
CBaseEntity *BuyWeaponByWeaponID_OrigFunc(CBasePlayer *pPlayer, WeaponIdType weaponID);
void ShowMenu_OrigFunc(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
void ShowVGUIMenu_OrigFunc(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu);

View File

@ -570,6 +570,10 @@ public:
void ChangeLevel_OrigFunc();
void GoToIntermission_OrigFunc();
void BalanceTeams_OrigFunc();
void Think_OrigFunc();
BOOL TeamFull_OrigFunc(int team_id);
BOOL TeamStacked_OrigFunc(int newTeam_id, int curTeam_id);
void PlayerGotWeapon_OrigFunc(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
#endif
public:

View File

@ -2122,7 +2122,9 @@ BOOL CHalfLifeMultiplay::IsThereABomb()
return FALSE;
}
BOOL CHalfLifeMultiplay::TeamFull(int team_id)
LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, TeamFull, (int team_id), team_id)
BOOL EXT_FUNC CHalfLifeMultiplay::__API_HOOK(TeamFull)(int team_id)
{
switch (team_id)
{
@ -2136,8 +2138,10 @@ BOOL CHalfLifeMultiplay::TeamFull(int team_id)
return FALSE;
}
LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, TeamStacked, (int newTeam_id, int curTeam_id), newTeam_id, curTeam_id)
// checks to see if the desired team is stacked, returns true if it is
BOOL CHalfLifeMultiplay::TeamStacked(int newTeam_id, int curTeam_id)
BOOL EXT_FUNC CHalfLifeMultiplay::__API_HOOK(TeamStacked)(int newTeam_id, int curTeam_id)
{
// players are allowed to change to their own team
if (newTeam_id == curTeam_id)
@ -2370,7 +2374,9 @@ void CHalfLifeMultiplay::PickNextVIP()
}
}
void CHalfLifeMultiplay::Think()
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, Think)
void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(Think)()
{
MonitorTutorStatus();
m_VoiceGameMgr.Update(gpGlobals->frametime);
@ -4201,8 +4207,10 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(DeathNotice)(CBasePlayer *pVictim,
MESSAGE_END();
}
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, PlayerGotWeapon, (CBasePlayer *pPlayer, CBasePlayerItem *pWeapon), pPlayer, pWeapon)
// Player has grabbed a weapon that was sitting in the world
void CHalfLifeMultiplay::PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerGotWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{
;
}
@ -4888,7 +4896,7 @@ void CHalfLifeMultiplay::ProcessMapVote(CBasePlayer *pPlayer, int iVote)
}
}
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, ChangeLevel);
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, ChangeLevel)
// Server is changing to a new level, check mapcycle.txt for map name and setup info
void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(ChangeLevel)()

View File

@ -4778,6 +4778,8 @@ void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)()
#endif
}
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, CheckTimeBasedDamage)
// If player is taking time based damage, continue doing damage to player -
// this simulates the effect of being poisoned, gassed, dosed with radiation etc -
// anything that continues to do damage even after the initial contact stops.
@ -4786,7 +4788,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)()
// The m_bitsDamageType bit MUST be set if any damage is to be taken.
// This routine will detect the initial on value of the m_bitsDamageType
// and init the appropriate counter. Only processes damage every second.
void CBasePlayer::CheckTimeBasedDamage()
void EXT_FUNC CBasePlayer::__API_HOOK(CheckTimeBasedDamage)()
{
int i;
byte bDuration = 0;
@ -5353,7 +5355,9 @@ CBaseEntity *g_pLastSpawn;
CBaseEntity *g_pLastCTSpawn;
CBaseEntity *g_pLastTerroristSpawn;
edict_t *CBasePlayer::EntSelectSpawnPoint()
LINK_HOOK_CLASS_CHAIN2(edict_t *, CBasePlayer, EntSelectSpawnPoint)
edict_t *EXT_FUNC CBasePlayer::__API_HOOK(EntSelectSpawnPoint)()
{
CBaseEntity *pSpot;

View File

@ -444,6 +444,8 @@ public:
void Pain_OrigFunc(int iLastHitGroup, bool bHasArmour);
void DeathSound_OrigFunc();
void JoiningThink_OrigFunc();
void CheckTimeBasedDamage_OrigFunc();
edict_t *EntSelectSpawnPoint_OrigFunc();
CCSPlayer *CSPlayer() const;
#endif // REGAMEDLL_API

View File

@ -74,16 +74,20 @@ float GetBaseAccuracy(WeaponIdType id)
return 0.0f;
}
LINK_HOOK_VOID_CHAIN2(ClearMultiDamage)
// Resets the global multi damage accumulator
void ClearMultiDamage()
void EXT_FUNC __API_HOOK(ClearMultiDamage)()
{
gMultiDamage.pEntity = nullptr;
gMultiDamage.amount = 0;
gMultiDamage.type = 0;
}
LINK_HOOK_VOID_CHAIN(ApplyMultiDamage, (entvars_t *pevInflictor, entvars_t *pevAttacker), pevInflictor, pevAttacker)
// Inflicts contents of global multi damage register on gMultiDamage.pEntity
void ApplyMultiDamage(entvars_t *pevInflictor, entvars_t *pevAttacker)
void EXT_FUNC __API_HOOK(ApplyMultiDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker)
{
if (!gMultiDamage.pEntity)
return;
@ -92,7 +96,9 @@ void ApplyMultiDamage(entvars_t *pevInflictor, entvars_t *pevAttacker)
}
void AddMultiDamage(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType)
LINK_HOOK_VOID_CHAIN(AddMultiDamage, (entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType), pevInflictor, pEntity, flDamage, bitsDamageType)
void EXT_FUNC __API_HOOK(AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType)
{
if (!pEntity)
return;
@ -208,10 +214,16 @@ struct {
#endif
// Precaches the ammo and queues the ammo info for sending to clients
void AddAmmoNameToAmmoRegistry(const char *szAmmoname)
int AddAmmoNameToAmmoRegistry(const char *szAmmoname)
{
// string validation
if (!szAmmoname || !szAmmoname[0])
{
return -1;
}
// make sure it's not already in the registry
for (int i = 0; i < MAX_AMMO_SLOTS; i++)
for (int i = 1; i < MAX_AMMO_SLOTS; i++)
{
if (!CBasePlayerItem::m_AmmoInfoArray[i].pszName)
continue;
@ -219,7 +231,7 @@ void AddAmmoNameToAmmoRegistry(const char *szAmmoname)
if (!Q_stricmp(CBasePlayerItem::m_AmmoInfoArray[i].pszName, szAmmoname))
{
// ammo already in registry, just quite
return;
return i;
}
}
@ -227,7 +239,7 @@ void AddAmmoNameToAmmoRegistry(const char *szAmmoname)
assert(giAmmoIndex < MAX_AMMO_SLOTS);
if (giAmmoIndex >= MAX_AMMO_SLOTS)
giAmmoIndex = 0;
giAmmoIndex = 1;
#ifdef REGAMEDLL_ADD
for (auto& ammo : ammoIndex)
@ -246,6 +258,8 @@ void AddAmmoNameToAmmoRegistry(const char *szAmmoname)
// Yes, this info is redundant
CBasePlayerItem::m_AmmoInfoArray[giAmmoIndex].iId = giAmmoIndex;
return giAmmoIndex;
}
// Precaches the weapon and queues the weapon info for sending to clients
@ -269,15 +283,8 @@ void UTIL_PrecacheOtherWeapon(const char *szClassname)
{
CBasePlayerItem::m_ItemInfoArray[info.iId] = info;
if (info.pszAmmo1 && info.pszAmmo1[0] != '\0')
{
AddAmmoNameToAmmoRegistry(info.pszAmmo1);
}
if (info.pszAmmo2 && info.pszAmmo2[0] != '\0')
{
AddAmmoNameToAmmoRegistry(info.pszAmmo2);
}
AddAmmoNameToAmmoRegistry(info.pszAmmo1);
AddAmmoNameToAmmoRegistry(info.pszAmmo2);
}
}
@ -691,7 +698,9 @@ bool CBasePlayerWeapon::ShieldSecondaryFire(int iUpAnim, int iDownAnim)
return true;
}
void CBasePlayerWeapon::KickBack(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change)
LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayerWeapon, KickBack, (float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change), up_base, lateral_base, up_modifier, lateral_modifier, up_max, lateral_max, direction_change)
void EXT_FUNC CBasePlayerWeapon::__API_HOOK(KickBack)(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change)
{
real_t flKickUp;
float flKickLateral;
@ -896,7 +905,9 @@ void CBasePlayerWeapon::HandleInfiniteAmmo()
}
}
void CBasePlayerWeapon::ItemPostFrame()
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayerWeapon, ItemPostFrame)
void EXT_FUNC CBasePlayerWeapon::__API_HOOK(ItemPostFrame)()
{
int usableButtons = m_pPlayer->pev->button;
@ -1285,7 +1296,9 @@ int CBasePlayerWeapon::UpdateClientData(CBasePlayer *pPlayer)
return 1;
}
void CBasePlayerWeapon::SendWeaponAnim(int iAnim, int skiplocal)
LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayerWeapon, SendWeaponAnim, (int iAnim, int skiplocal), iAnim, skiplocal)
void EXT_FUNC CBasePlayerWeapon::__API_HOOK(SendWeaponAnim)(int iAnim, int skiplocal)
{
m_pPlayer->pev->weaponanim = iAnim;
@ -2644,3 +2657,4 @@ int CBasePlayerItem::iFlags() const
{
return m_ItemInfoEx.iFlags;
}

View File

@ -403,6 +403,9 @@ public:
BOOL DefaultDeploy_OrigFunc(char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal);
BOOL DefaultReload_OrigFunc(int iClipSize, int iAnim, float fDelay);
bool DefaultShotgunReload_OrigFunc(int iAnim, int iStartAnim, float fDelay, float fStartDelay, const char *pszReloadSound1, const char *pszReloadSound2);
void KickBack_OrigFunc(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change);
void SendWeaponAnim_OrigFunc(int iAnim, int skiplocal);
void ItemPostFrame_OrigFunc();
CCSPlayerWeapon *CSPlayerWeapon() const;
#endif
@ -2162,7 +2165,13 @@ int DamageDecal(CBaseEntity *pEntity, int bitsDamageType);
void DecalGunshot(TraceResult *pTrace, int iBulletType, bool ClientOnly, entvars_t *pShooter, bool bHitMetal);
void EjectBrass(const Vector &vecOrigin, const Vector &vecLeft, const Vector &vecVelocity, float rotation, int model, int soundtype, int entityIndex);
void EjectBrass2(const Vector &vecOrigin, const Vector &vecVelocity, float rotation, int model, int soundtype, entvars_t *pev);
void AddAmmoNameToAmmoRegistry(const char *szAmmoname);
int AddAmmoNameToAmmoRegistry(const char *szAmmoname);
void UTIL_PrecacheOtherWeapon(const char *szClassname);
BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted);
float GetBaseAccuracy(WeaponIdType id);
#ifdef REGAMEDLL_API
void ClearMultiDamage_OrigFunc();
void ApplyMultiDamage_OrigFunc(entvars_t *pevInflictor, entvars_t *pevAttacker);
void AddMultiDamage_OrigFunc(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
#endif

View File

@ -213,10 +213,12 @@ const char *CBotManager::GetNavMapFilename() const
return filename;
}
LINK_HOOK_CLASS_VOID_CHAIN(CBotManager, OnEvent, (GameEventType event, CBaseEntity* pEntity, CBaseEntity* pOther), event, pEntity, pOther)
// Invoked when given player does given event (some events have NULL player).
// Events are propogated to all bots.
// TODO: This has become the game-wide event dispatcher. We should restructure this.
void CBotManager::OnEvent(GameEventType event, CBaseEntity *pEntity, CBaseEntity *pOther)
void CBotManager::__API_HOOK(OnEvent)(GameEventType event, CBaseEntity* pEntity, CBaseEntity* pOther)
{
// propogate event to all bots
for (int i = 1; i <= gpGlobals->maxClients; i++)

View File

@ -81,6 +81,10 @@ public:
virtual void OnEvent(GameEventType event, CBaseEntity *pEntity = nullptr, CBaseEntity *pOther = nullptr); // Invoked when event occurs in the game (some events have NULL entity).
virtual unsigned int GetPlayerPriority(CBasePlayer *pPlayer) const = 0; // return priority of player (0 = max pri)
#ifdef REGAMEDLL_API
void OnEvent_OrigFunc(GameEventType event, CBaseEntity* pEntity = nullptr, CBaseEntity* pOther = nullptr);
#endif
public:
const char *GetNavMapFilename() const; // return the filename for this map's "nav" file

View File

@ -162,7 +162,9 @@ char EXT_FUNC PM_FindTextureType(char *name)
return CHAR_TEX_CONCRETE;
}
void PM_PlayStepSound(int step, float fvol)
LINK_HOOK_VOID_CHAIN(PM_PlayStepSound, (int step, float fvol), step, fvol)
void EXT_FUNC __API_HOOK(PM_PlayStepSound)(int step, float fvol)
{
static int iSkipStep = 0;
int irand;
@ -365,7 +367,7 @@ void PM_CatagorizeTextureType()
pmove->chtexturetype = PM_FindTextureType(pmove->sztexturename);
}
LINK_HOOK_VOID_CHAIN2(PM_UpdateStepSound);
LINK_HOOK_VOID_CHAIN2(PM_UpdateStepSound)
void EXT_FUNC __API_HOOK(PM_UpdateStepSound)()
{
@ -1127,7 +1129,9 @@ void PM_Friction()
VectorCopy(newvel, pmove->velocity);
}
void PM_AirAccelerate(vec_t *wishdir, float wishspeed, float accel)
LINK_HOOK_VOID_CHAIN(PM_AirAccelerate, (vec_t *wishdir, float wishspeed, float accel), wishdir, wishspeed, accel)
void EXT_FUNC __API_HOOK(PM_AirAccelerate)(vec_t *wishdir, float wishspeed, float accel)
{
int i;
float addspeed;
@ -1274,7 +1278,7 @@ void PM_WaterMove()
PM_FlyMove();
}
LINK_HOOK_VOID_CHAIN(PM_AirMove, (int playerIndex = 0), pmove->player_index + 1);
LINK_HOOK_VOID_CHAIN(PM_AirMove, (int playerIndex = 0), pmove->player_index + 1)
void EXT_FUNC __API_HOOK(PM_AirMove)(int playerIndex)
{
@ -1793,7 +1797,9 @@ void PM_FixPlayerCrouchStuck(int direction)
VectorCopy(test, pmove->origin);
}
void PM_UnDuck()
LINK_HOOK_VOID_CHAIN2(PM_UnDuck)
void EXT_FUNC __API_HOOK(PM_UnDuck)()
{
#ifdef REGAMEDLL_ADD
if (unduck_method.value)
@ -1863,7 +1869,9 @@ void PM_UnDuck()
}
}
void PM_Duck()
LINK_HOOK_VOID_CHAIN2(PM_Duck)
void EXT_FUNC __API_HOOK(PM_Duck)()
{
int buttonsChanged = (pmove->oldbuttons ^ pmove->cmd.buttons); // These buttons have changed this frame
int nButtonPressed = buttonsChanged & pmove->cmd.buttons; // The changed ones still down are "pressed"
@ -1967,7 +1975,7 @@ void PM_Duck()
}
}
LINK_HOOK_VOID_CHAIN(PM_LadderMove, (physent_t *pLadder), pLadder);
LINK_HOOK_VOID_CHAIN(PM_LadderMove, (physent_t *pLadder), pLadder)
void EXT_FUNC __API_HOOK(PM_LadderMove)(physent_t *pLadder)
{
@ -2119,7 +2127,9 @@ physent_t *PM_Ladder()
return nullptr;
}
void PM_WaterJump()
LINK_HOOK_VOID_CHAIN2(PM_WaterJump)
void EXT_FUNC __API_HOOK(PM_WaterJump)()
{
if (pmove->waterjumptime > 10000)
{
@ -2344,7 +2354,9 @@ void PM_PreventMegaBunnyJumping()
VectorScale(pmove->velocity, fraction, pmove->velocity);
}
void PM_Jump()
LINK_HOOK_VOID_CHAIN2(PM_Jump)
void EXT_FUNC __API_HOOK(PM_Jump)()
{
if (pmove->dead)
{
@ -2516,7 +2528,9 @@ void PM_Jump()
pmove->oldbuttons |= IN_JUMP;
}
void PM_CheckWaterJump()
LINK_HOOK_VOID_CHAIN2(PM_CheckWaterJump)
void EXT_FUNC __API_HOOK(PM_CheckWaterJump)()
{
vec3_t vecStart, vecEnd;
vec3_t flatforward;
@ -3209,7 +3223,7 @@ void PM_CreateStuckTable()
}
}
LINK_HOOK_VOID_CHAIN(PM_Move, (struct playermove_s *ppmove, int server), ppmove, server);
LINK_HOOK_VOID_CHAIN(PM_Move, (struct playermove_s *ppmove, int server), ppmove, server)
// This module implements the shared player physics code between any particular game and
// the engine. The same PM_Move routine is built into the game .dll and the client .dll and is
@ -3254,7 +3268,7 @@ NOXREF int PM_GetPhysEntInfo(int ent)
return -1;
}
LINK_HOOK_VOID_CHAIN(PM_Init, (struct playermove_s *ppmove), ppmove);
LINK_HOOK_VOID_CHAIN(PM_Init, (struct playermove_s *ppmove), ppmove)
void EXT_FUNC __API_HOOK(PM_Init)(struct playermove_s *ppmove)
{

View File

@ -85,6 +85,13 @@ 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);
void PM_WaterJump_OrigFunc();
void PM_CheckWaterJump_OrigFunc();
void PM_Jump_OrigFunc();
void PM_Duck_OrigFunc();
void PM_UnDuck_OrigFunc();
void PM_PlayStepSound_OrigFunc(int step, float fvol);
void PM_AirAccelerate_OrigFunc(vec_t *wishdir, float wishspeed, float accel);
#else
void PM_AirMove(int playerIndex = 0);
#endif

View File

@ -38,7 +38,7 @@
#include <API/CSInterfaces.h>
#define REGAMEDLL_API_VERSION_MAJOR 5
#define REGAMEDLL_API_VERSION_MINOR 22
#define REGAMEDLL_API_VERSION_MINOR 23
// CBasePlayer::Spawn hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
@ -236,10 +236,6 @@ typedef IHookChainRegistry<void, struct playermove_s *, int> IReGameHookRegistry
typedef IHookChain<void, int> IReGameHook_PM_AirMove;
typedef IHookChainRegistry<void, int> IReGameHookRegistry_PM_AirMove;
// PM_LadderMove hook
typedef IHookChain<void, struct physent_s *> IReGameHook_PM_LadderMove;
typedef IHookChainRegistry<void, struct physent_s *> IReGameHookRegistry_PM_LadderMove;
// HandleMenu_ChooseAppearance hook
typedef IHookChain<void, class CBasePlayer *, int> IReGameHook_HandleMenu_ChooseAppearance;
typedef IHookChainRegistry<void, class CBasePlayer *, int> IReGameHookRegistry_HandleMenu_ChooseAppearance;
@ -528,6 +524,94 @@ typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBa
typedef IHookChain<void, class CGameRules **> IReGameHook_FreeGameRules;
typedef IHookChainRegistry<void, class CGameRules **> IReGameHookRegistry_FreeGameRules;
// PM_LadderMove hook
typedef IHookChain<void, struct physent_s *> IReGameHook_PM_LadderMove;
typedef IHookChainRegistry<void, struct physent_s *> IReGameHookRegistry_PM_LadderMove;
// PM_WaterJump hook
typedef IHookChain<void> IReGameHook_PM_WaterJump;
typedef IHookChainRegistry<void> IReGameHookRegistry_PM_WaterJump;
// PM_CheckWaterJump hook
typedef IHookChain<void> IReGameHook_PM_CheckWaterJump;
typedef IHookChainRegistry<void> IReGameHookRegistry_PM_CheckWaterJump;
// PM_Jump hook
typedef IHookChain<void> IReGameHook_PM_Jump;
typedef IHookChainRegistry<void> IReGameHookRegistry_PM_Jump;
// PM_Duck hook
typedef IHookChain<void> IReGameHook_PM_Duck;
typedef IHookChainRegistry<void> IReGameHookRegistry_PM_Duck;
// PM_UnDuck hook
typedef IHookChain<void> IReGameHook_PM_UnDuck;
typedef IHookChainRegistry<void> IReGameHookRegistry_PM_UnDuck;
// PM_PlayStepSound hook
typedef IHookChain<void, int, float> IReGameHook_PM_PlayStepSound;
typedef IHookChainRegistry<void, int, float> IReGameHookRegistry_PM_PlayStepSound;
// PM_AirAccelerate hook
typedef IHookChain<void, vec_t *, float, float> IReGameHook_PM_AirAccelerate;
typedef IHookChainRegistry<void, vec_t *, float, float> IReGameHookRegistry_PM_AirAccelerate;
// ClearMultiDamage hook
typedef IHookChain<void> IReGameHook_ClearMultiDamage;
typedef IHookChainRegistry<void> IReGameHookRegistry_ClearMultiDamage;
// AddMultiDamage hook
typedef IHookChain<void, entvars_t *, CBaseEntity *, float, int> IReGameHook_AddMultiDamage;
typedef IHookChainRegistry<void, entvars_t *, CBaseEntity *, float, int> IReGameHookRegistry_AddMultiDamage;
// ApplyMultiDamage hook
typedef IHookChain<void, entvars_t *, entvars_t *> IReGameHook_ApplyMultiDamage;
typedef IHookChainRegistry<void, entvars_t *, entvars_t *> IReGameHookRegistry_ApplyMultiDamage;
// BuyItem hook
typedef IHookChain<void, CBasePlayer *, int> IReGameHook_BuyItem;
typedef IHookChainRegistry<void, CBasePlayer *, int> IReGameHookRegistry_BuyItem;
// CHalfLifeMultiplay::Think hook
typedef IHookChain<void> IReGameHook_CSGameRules_Think;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_Think;
// CHalfLifeMultiplay::TeamFull hook
typedef IHookChain<BOOL, int> IReGameHook_CSGameRules_TeamFull;
typedef IHookChainRegistry<BOOL, int> IReGameHookRegistry_CSGameRules_TeamFull;
// CHalfLifeMultiplay::TeamStacked hook
typedef IHookChain<BOOL, int, int> IReGameHook_CSGameRules_TeamStacked;
typedef IHookChainRegistry<BOOL, int, int> IReGameHookRegistry_CSGameRules_TeamStacked;
// CHalfLifeMultiplay::PlayerGotWeapon hook
typedef IHookChain<void, CBasePlayer *, CBasePlayerItem *> IReGameHook_CSGameRules_PlayerGotWeapon;
typedef IHookChainRegistry<void, CBasePlayer *, CBasePlayerItem *> IReGameHookRegistry_CSGameRules_PlayerGotWeapon;
// CBotManager::OnEvent hook
typedef IHookChain<void, GameEventType, CBaseEntity *, CBaseEntity *> IReGameHook_CBotManager_OnEvent;
typedef IHookChainRegistry<void, GameEventType, CBaseEntity*, CBaseEntity*> IReGameHookRegistry_CBotManager_OnEvent;
// CBasePlayer::CheckTimeBasedDamage hook
typedef IHookChainClass<void, CBasePlayer> IReGameHook_CBasePlayer_CheckTimeBasedDamage;
typedef IHookChainRegistryClass<void, CBasePlayer> IReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage;
// CBasePlayer::EntSelectSpawnPoint hook
typedef IHookChainClass<edict_t *, CBasePlayer> IReGameHook_CBasePlayer_EntSelectSpawnPoint;
typedef IHookChainRegistryClass<edict_t *, CBasePlayer> IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint;
// CBasePlayerWeapon::ItemPostFrame hook
typedef IHookChainClass<void, CBasePlayerWeapon> IReGameHook_CBasePlayerWeapon_ItemPostFrame;
typedef IHookChainRegistryClass<void, CBasePlayerWeapon> IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame;
// CBasePlayerWeapon::KickBack hook
typedef IHookChainClass<void, CBasePlayerWeapon, float, float, float, float, float, float, int> IReGameHook_CBasePlayerWeapon_KickBack;
typedef IHookChainRegistryClass<void, CBasePlayerWeapon, float, float, float, float, float, float, int> IReGameHookRegistry_CBasePlayerWeapon_KickBack;
// CBasePlayerWeapon::SendWeaponAnim hook
typedef IHookChainClass<void, CBasePlayerWeapon, int, int> IReGameHook_CBasePlayerWeapon_SendWeaponAnim;
typedef IHookChainRegistryClass<void, CBasePlayerWeapon, int, int> IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim;
class IReGameHookchains {
public:
virtual ~IReGameHookchains() {}
@ -664,6 +748,27 @@ public:
virtual IReGameHookRegistry_FreeGameRules *FreeGameRules() = 0;
virtual IReGameHookRegistry_PM_LadderMove *PM_LadderMove() = 0;
virtual IReGameHookRegistry_PM_WaterJump *PM_WaterJump() = 0;
virtual IReGameHookRegistry_PM_CheckWaterJump *PM_CheckWaterJump() = 0;
virtual IReGameHookRegistry_PM_Jump *PM_Jump() = 0;
virtual IReGameHookRegistry_PM_Duck *PM_Duck() = 0;
virtual IReGameHookRegistry_PM_UnDuck *PM_UnDuck() = 0;
virtual IReGameHookRegistry_PM_PlayStepSound *PM_PlayStepSound() = 0;
virtual IReGameHookRegistry_PM_AirAccelerate *PM_AirAccelerate() = 0;
virtual IReGameHookRegistry_ClearMultiDamage *ClearMultiDamage() = 0;
virtual IReGameHookRegistry_AddMultiDamage *AddMultiDamage() = 0;
virtual IReGameHookRegistry_ApplyMultiDamage *ApplyMultiDamage() = 0;
virtual IReGameHookRegistry_BuyItem *BuyItem() = 0;
virtual IReGameHookRegistry_CSGameRules_Think *CSGameRules_Think() = 0;
virtual IReGameHookRegistry_CSGameRules_TeamFull *CSGameRules_TeamFull() = 0;
virtual IReGameHookRegistry_CSGameRules_TeamStacked *CSGameRules_TeamStacked() = 0;
virtual IReGameHookRegistry_CSGameRules_PlayerGotWeapon *CSGameRules_PlayerGotWeapon() = 0;
virtual IReGameHookRegistry_CBotManager_OnEvent *CBotManager_OnEvent() = 0;
virtual IReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage *CBasePlayer_CheckTimeBasedDamage() = 0;
virtual IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint *CBasePlayer_EntSelectSpawnPoint() = 0;
virtual IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame *CBasePlayerWeapon_ItemPostFrame() = 0;
virtual IReGameHookRegistry_CBasePlayerWeapon_KickBack *CBasePlayerWeapon_KickBack() = 0;
virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim() = 0;
};
struct ReGameFuncs_t {
@ -684,6 +789,12 @@ struct ReGameFuncs_t {
void (*UTIL_RestartOther)(const char *szClassname);
void (*UTIL_ResetEntities)();
void (*UTIL_RemoveOther)(const char *szClassname, int nCount);
void (*UTIL_DecalTrace)(TraceResult *pTrace, int decalNumber);
void (*UTIL_Remove)(CBaseEntity *pEntity);
int (*AddAmmoNameToAmmoRegistry)(const char *szAmmoname);
void (*TextureTypePlaySound)(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType);
class CWeaponBox *(*CreateWeaponBox)(CBasePlayerItem *pItem, CBasePlayer *pPlayerOwner, const char *modelName, Vector &origin, Vector &angles, Vector &velocity, float lifeTime, bool packAmmo);
class CGrenade *(*SpawnGrenade)(WeaponIdType weaponId, entvars_t *pevOwner, Vector &vecSrc, Vector &vecThrow, float time, int iTeam, unsigned short usEvent);
};
class IReGameApi {