From 6701c5824727a0622607acb098c025ea671b8e9c Mon Sep 17 00:00:00 2001 From: dystopm Date: Sat, 15 Jul 2023 20:54:21 -0400 Subject: [PATCH 01/13] Ordered PM_LadderMove declarations --- regamedll/dlls/API/CAPI_Impl.h | 11 +++++------ regamedll/public/regamedll/regamedll_api.h | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index 5c7169ae0..899dc6112 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -357,10 +357,6 @@ 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; @@ -649,6 +645,10 @@ typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBase typedef IHookChainImpl CReGameHook_FreeGameRules; typedef IHookChainRegistryImpl CReGameHookRegistry_FreeGameRules; +// PM_LadderMove hook +typedef IHookChainImpl CReGameHook_PM_LadderMove; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_LadderMove; + class CReGameHookchains: public IReGameHookchains { public: // CBasePlayer virtual @@ -782,9 +782,8 @@ class CReGameHookchains: public IReGameHookchains { 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; public: virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn(); diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 43b7825aa..bfd6caf25 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -236,10 +236,6 @@ 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; @@ -528,6 +524,10 @@ typedef IHookChainRegistryClass IReGameHookRegistry_CBa typedef IHookChain IReGameHook_FreeGameRules; typedef IHookChainRegistry IReGameHookRegistry_FreeGameRules; +// PM_LadderMove hook +typedef IHookChain IReGameHook_PM_LadderMove; +typedef IHookChainRegistry IReGameHookRegistry_PM_LadderMove; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} From 639f45f860042391545a5bdeb7394824be276630 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sat, 15 Jul 2023 21:32:50 -0400 Subject: [PATCH 02/13] Added six new API funcs (plus code cleaning) - Deleted declarations on CAPI_Impl.h - Moved definitions on CAPI_Impl.cpp to the top - Corrected EXT_FUNC order in functions definitions - Added six new API funcs to export --- regamedll/dlls/API/CAPI_Impl.cpp | 172 ++++++++++++++------- regamedll/dlls/API/CAPI_Impl.h | 11 -- regamedll/public/regamedll/regamedll_api.h | 6 + 3 files changed, 120 insertions(+), 69 deletions(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 292d0b454..e535f4868 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -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); +} + +void EXT_FUNC AddAmmoNameToAmmoRegistry_api(const char *szAmmoname) +{ + 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); @@ -272,48 +372,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); diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index 899dc6112..c63be9758 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -944,14 +944,3 @@ class CReGameApi: public IReGameApi { 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); diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index bfd6caf25..15e6593e3 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -684,6 +684,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); + void (*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 { From 2990bfc013b628072ccbeaf0aa49bdbfbb09f3d2 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sat, 15 Jul 2023 22:38:36 -0400 Subject: [PATCH 03/13] Added fourteen new Hooks - 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 --- regamedll/dlls/API/CAPI_Impl.cpp | 14 ++++ regamedll/dlls/API/CAPI_Impl.h | 84 ++++++++++++++++++++++ regamedll/dlls/gamerules.h | 3 + regamedll/dlls/multiplay_gamerules.cpp | 12 +++- regamedll/dlls/player.cpp | 4 +- regamedll/dlls/player.h | 1 + regamedll/dlls/weapons.cpp | 20 ++++-- regamedll/dlls/weapons.h | 8 +++ regamedll/game_shared/bot/bot_manager.cpp | 4 +- regamedll/game_shared/bot/bot_manager.h | 4 ++ regamedll/pm_shared/pm_shared.cpp | 26 ++++--- regamedll/pm_shared/pm_shared.h | 4 ++ regamedll/public/regamedll/regamedll_api.h | 70 ++++++++++++++++++ 13 files changed, 235 insertions(+), 19 deletions(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index e535f4868..5606279d9 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -310,6 +310,20 @@ GAMEHOOK_REGISTRY(CBasePlayer_JoiningThink); GAMEHOOK_REGISTRY(FreeGameRules); GAMEHOOK_REGISTRY(PM_LadderMove); +GAMEHOOK_REGISTRY(PM_CheckWaterJump); +GAMEHOOK_REGISTRY(PM_Jump); +GAMEHOOK_REGISTRY(PM_Duck); +GAMEHOOK_REGISTRY(PM_UnDuck); +GAMEHOOK_REGISTRY(ClearMultiDamage); +GAMEHOOK_REGISTRY(AddMultiDamage); +GAMEHOOK_REGISTRY(ApplyMultiDamage); +GAMEHOOK_REGISTRY(CSGameRules_TeamFull); +GAMEHOOK_REGISTRY(CSGameRules_TeamStacked); +GAMEHOOK_REGISTRY(CSGameRules_PlayerGotWeapon); +GAMEHOOK_REGISTRY(CBotManager_OnEvent); +GAMEHOOK_REGISTRY(CBasePlayer_EntSelectSpawnPoint); +GAMEHOOK_REGISTRY(CBasePlayerWeapon_KickBack); +GAMEHOOK_REGISTRY(CBasePlayerWeapon_SendWeaponAnim); 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 c63be9758..8c8bbf118 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -649,6 +649,62 @@ typedef IHookChainRegistryImpl CReGameHookRegistry_FreeGame typedef IHookChainImpl CReGameHook_PM_LadderMove; typedef IHookChainRegistryImpl CReGameHookRegistry_PM_LadderMove; +// PM_CheckWaterJump hook +typedef IHookChainImpl CReGameHook_PM_CheckWaterJump; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_CheckWaterJump; + +// PM_Jump hook +typedef IHookChainImpl CReGameHook_PM_Jump; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_Jump; + +// PM_Duck hook +typedef IHookChainImpl CReGameHook_PM_Duck; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_Duck; + +// PM_UnDuck hook +typedef IHookChainImpl CReGameHook_PM_UnDuck; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_UnDuck; + +// ClearMultiDamage hook +typedef IHookChainImpl CReGameHook_ClearMultiDamage; +typedef IHookChainRegistryImpl CReGameHookRegistry_ClearMultiDamage; + +// AddMultiDamage hook +typedef IHookChainImpl CReGameHook_AddMultiDamage; +typedef IHookChainRegistryImpl CReGameHookRegistry_AddMultiDamage; + +// ApplyMultiDamage hook +typedef IHookChainImpl CReGameHook_ApplyMultiDamage; +typedef IHookChainRegistryImpl CReGameHookRegistry_ApplyMultiDamage; + +// CHalfLifeMultiplay::TeamFull hook +typedef IHookChainClassImpl CReGameHook_CSGameRules_TeamFull; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_TeamFull; + +// CHalfLifeMultiplay::TeamStacked hook +typedef IHookChainClassImpl CReGameHook_CSGameRules_TeamStacked; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_TeamStacked; + +// CHalfLifeMultiplay::PlayerGotWeapon hook +typedef IHookChainClassImpl CReGameHook_CSGameRules_PlayerGotWeapon; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_PlayerGotWeapon; + +// CBotManager::OnEvent hook +typedef IHookChainClassImpl CReGameHook_CBotManager_OnEvent; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CBotManager_OnEvent; + +// CBasePlayer::EntSelectSpawnPoint hook +typedef IHookChainClassImpl CReGameHook_CBasePlayer_EntSelectSpawnPoint; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; + +// CBasePlayerWeapon::KickBack hook +typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_KickBack; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayerWeapon_KickBack; + +// CBasePlayerWeapon::SendWeaponAnim hook +typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_SendWeaponAnim; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim; + class CReGameHookchains: public IReGameHookchains { public: // CBasePlayer virtual @@ -784,6 +840,20 @@ class CReGameHookchains: public IReGameHookchains { CReGameHookRegistry_FreeGameRules m_FreeGameRules; CReGameHookRegistry_PM_LadderMove m_PM_LadderMove; + 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_ClearMultiDamage m_ClearMultiDamage; + CReGameHookRegistry_AddMultiDamage m_AddMultiDamage; + CReGameHookRegistry_ApplyMultiDamage m_ApplyMultiDamage; + 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_EntSelectSpawnPoint m_CBasePlayer_EntSelectSpawnPoint; + CReGameHookRegistry_CBasePlayerWeapon_KickBack m_CBasePlayerWeapon_KickBack; + CReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim m_CBasePlayerWeapon_SendWeaponAnim; public: virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn(); @@ -918,6 +988,20 @@ class CReGameHookchains: public IReGameHookchains { virtual IReGameHookRegistry_FreeGameRules *FreeGameRules(); virtual IReGameHookRegistry_PM_LadderMove *PM_LadderMove(); + 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_ClearMultiDamage *ClearMultiDamage(); + virtual IReGameHookRegistry_AddMultiDamage *AddMultiDamage(); + virtual IReGameHookRegistry_ApplyMultiDamage *ApplyMultiDamage(); + 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_EntSelectSpawnPoint *CBasePlayer_EntSelectSpawnPoint(); + virtual IReGameHookRegistry_CBasePlayerWeapon_KickBack *CBasePlayerWeapon_KickBack(); + virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim(); }; extern CReGameHookchains g_ReGameHookchains; diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index f6c621bd8..766c07b0a 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -570,6 +570,9 @@ class CHalfLifeMultiplay: public CGameRules void ChangeLevel_OrigFunc(); void GoToIntermission_OrigFunc(); void BalanceTeams_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: diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index baf916589..86ddc81e6 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -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) @@ -4201,8 +4205,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) { ; } diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index b8c800795..0a6f1a765 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -5359,7 +5359,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; diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index e2f76c680..fd4577709 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -444,6 +444,7 @@ class CBasePlayer: public CBaseMonster { void Pain_OrigFunc(int iLastHitGroup, bool bHasArmour); void DeathSound_OrigFunc(); void JoiningThink_OrigFunc(); + edict_t *EntSelectSpawnPoint_OrigFunc(); CCSPlayer *CSPlayer() const; #endif // REGAMEDLL_API diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index ac9aaea90..a9469311a 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -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; @@ -691,7 +697,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; @@ -1279,7 +1287,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; diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index ad4662c1b..fb9117732 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -403,6 +403,8 @@ class CBasePlayerWeapon: public CBasePlayerItem 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); CCSPlayerWeapon *CSPlayerWeapon() const; #endif @@ -2166,3 +2168,9 @@ void 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 \ No newline at end of file diff --git a/regamedll/game_shared/bot/bot_manager.cpp b/regamedll/game_shared/bot/bot_manager.cpp index 6e75cef75..285a26a36 100644 --- a/regamedll/game_shared/bot/bot_manager.cpp +++ b/regamedll/game_shared/bot/bot_manager.cpp @@ -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++) diff --git a/regamedll/game_shared/bot/bot_manager.h b/regamedll/game_shared/bot/bot_manager.h index 788c54ca9..dfcfd8edc 100644 --- a/regamedll/game_shared/bot/bot_manager.h +++ b/regamedll/game_shared/bot/bot_manager.h @@ -81,6 +81,10 @@ class CBotManager 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 diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index b3b57fa5d..55a809936 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -365,7 +365,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)() { @@ -1274,7 +1274,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 +1793,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 +1865,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 +1971,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) { @@ -2344,7 +2348,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 +2522,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 +3217,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 +3262,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) { diff --git a/regamedll/pm_shared/pm_shared.h b/regamedll/pm_shared/pm_shared.h index da15fb5b0..b34921bdc 100644 --- a/regamedll/pm_shared/pm_shared.h +++ b/regamedll/pm_shared/pm_shared.h @@ -85,6 +85,10 @@ 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_CheckWaterJump_Orig(); +void PM_Jump_Orig(); +void PM_Duck_Orig(); +void PM_UnDuck_Orig(); #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 15e6593e3..4c06ab7e0 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -528,6 +528,62 @@ typedef IHookChainRegistry IReGameHookRegistry_FreeGa typedef IHookChain IReGameHook_PM_LadderMove; typedef IHookChainRegistry IReGameHookRegistry_PM_LadderMove; +// PM_CheckWaterJump hook +typedef IHookChain IReGameHook_PM_CheckWaterJump; +typedef IHookChainRegistry IReGameHookRegistry_PM_CheckWaterJump; + +// PM_Jump hook +typedef IHookChain IReGameHook_PM_Jump; +typedef IHookChainRegistry IReGameHookRegistry_PM_Jump; + +// PM_Duck hook +typedef IHookChain IReGameHook_PM_Duck; +typedef IHookChainRegistry IReGameHookRegistry_PM_Duck; + +// PM_UnDuck hook +typedef IHookChain IReGameHook_PM_UnDuck; +typedef IHookChainRegistry IReGameHookRegistry_PM_UnDuck; + +// ClearMultiDamage hook +typedef IHookChain IReGameHook_ClearMultiDamage; +typedef IHookChainRegistry IReGameHookRegistry_ClearMultiDamage; + +// AddMultiDamage hook +typedef IHookChain IReGameHook_AddMultiDamage; +typedef IHookChainRegistry IReGameHookRegistry_AddMultiDamage; + +// ApplyMultiDamage hook +typedef IHookChain IReGameHook_ApplyMultiDamage; +typedef IHookChainRegistry IReGameHookRegistry_ApplyMultiDamage; + +// CHalfLifeMultiplay::TeamFull hook +typedef IHookChainClass IReGameHook_CSGameRules_TeamFull; +typedef IHookChainRegistryClass IReGameHookRegistry_CSGameRules_TeamFull; + +// CHalfLifeMultiplay::TeamStacked hook +typedef IHookChainClass IReGameHook_CSGameRules_TeamStacked; +typedef IHookChainRegistryClass IReGameHookRegistry_CSGameRules_TeamStacked; + +// CHalfLifeMultiplay::PlayerGotWeapon hook +typedef IHookChainClass IReGameHook_CSGameRules_PlayerGotWeapon; +typedef IHookChainRegistryClass IReGameHookRegistry_CSGameRules_PlayerGotWeapon; + +// CBotManager::OnEvent hook +typedef IHookChainClass IReGameHook_CBotManager_OnEvent; +typedef IHookChainRegistryClass IReGameHookRegistry_CBotManager_OnEvent; + +// CBasePlayer::EntSelectSpawnPoint hook +typedef IHookChainClass IReGameHook_CBasePlayer_EntSelectSpawnPoint; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; + +// CBasePlayerWeapon::KickBack hook +typedef IHookChainClass IReGameHook_CBasePlayerWeapon_KickBack; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_KickBack; + +// CBasePlayerWeapon::SendWeaponAnim hook +typedef IHookChainClass IReGameHook_CBasePlayerWeapon_SendWeaponAnim; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -664,6 +720,20 @@ class IReGameHookchains { virtual IReGameHookRegistry_FreeGameRules *FreeGameRules() = 0; virtual IReGameHookRegistry_PM_LadderMove *PM_LadderMove() = 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_ClearMultiDamage *ClearMultiDamage() = 0; + virtual IReGameHookRegistry_AddMultiDamage *AddMultiDamage() = 0; + virtual IReGameHookRegistry_ApplyMultiDamage *ApplyMultiDamage() = 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_EntSelectSpawnPoint *CBasePlayer_EntSelectSpawnPoint() = 0; + virtual IReGameHookRegistry_CBasePlayerWeapon_KickBack *CBasePlayerWeapon_KickBack() = 0; + virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim() = 0; }; struct ReGameFuncs_t { From 872bd17ce1512e00016b894abbb894c5abe02623 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sat, 15 Jul 2023 23:10:22 -0400 Subject: [PATCH 04/13] Compile errors fix --- regamedll/dlls/API/CAPI_Impl.h | 4 ++-- regamedll/pm_shared/pm_shared.h | 8 ++++---- regamedll/public/regamedll/regamedll_api.h | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index 8c8bbf118..2ca0f9368 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -698,8 +698,8 @@ typedef IHookChainClassImpl CReGameHook_CBasePlayer_EntS typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; // CBasePlayerWeapon::KickBack hook -typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_KickBack; -typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayerWeapon_KickBack; +typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_KickBack; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayerWeapon_KickBack; // CBasePlayerWeapon::SendWeaponAnim hook typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_SendWeaponAnim; diff --git a/regamedll/pm_shared/pm_shared.h b/regamedll/pm_shared/pm_shared.h index b34921bdc..f4d80a83b 100644 --- a/regamedll/pm_shared/pm_shared.h +++ b/regamedll/pm_shared/pm_shared.h @@ -85,10 +85,10 @@ 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_CheckWaterJump_Orig(); -void PM_Jump_Orig(); -void PM_Duck_Orig(); -void PM_UnDuck_Orig(); +void PM_CheckWaterJump_OrigFunc(); +void PM_Jump_OrigFunc(); +void PM_Duck_OrigFunc(); +void PM_UnDuck_OrigFunc(); #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 4c06ab7e0..9bff07002 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -557,28 +557,28 @@ typedef IHookChain IReGameHook_ApplyMultiDamage; typedef IHookChainRegistry IReGameHookRegistry_ApplyMultiDamage; // CHalfLifeMultiplay::TeamFull hook -typedef IHookChainClass IReGameHook_CSGameRules_TeamFull; -typedef IHookChainRegistryClass IReGameHookRegistry_CSGameRules_TeamFull; +typedef IHookChain IReGameHook_CSGameRules_TeamFull; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_TeamFull; // CHalfLifeMultiplay::TeamStacked hook -typedef IHookChainClass IReGameHook_CSGameRules_TeamStacked; -typedef IHookChainRegistryClass IReGameHookRegistry_CSGameRules_TeamStacked; +typedef IHookChain IReGameHook_CSGameRules_TeamStacked; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_TeamStacked; // CHalfLifeMultiplay::PlayerGotWeapon hook -typedef IHookChainClass IReGameHook_CSGameRules_PlayerGotWeapon; -typedef IHookChainRegistryClass IReGameHookRegistry_CSGameRules_PlayerGotWeapon; +typedef IHookChain IReGameHook_CSGameRules_PlayerGotWeapon; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerGotWeapon; // CBotManager::OnEvent hook -typedef IHookChainClass IReGameHook_CBotManager_OnEvent; -typedef IHookChainRegistryClass IReGameHookRegistry_CBotManager_OnEvent; +typedef IHookChain IReGameHook_CBotManager_OnEvent; +typedef IHookChainRegistry IReGameHookRegistry_CBotManager_OnEvent; // CBasePlayer::EntSelectSpawnPoint hook typedef IHookChainClass IReGameHook_CBasePlayer_EntSelectSpawnPoint; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; // CBasePlayerWeapon::KickBack hook -typedef IHookChainClass IReGameHook_CBasePlayerWeapon_KickBack; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_KickBack; +typedef IHookChainClass IReGameHook_CBasePlayerWeapon_KickBack; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_KickBack; // CBasePlayerWeapon::SendWeaponAnim hook typedef IHookChainClass IReGameHook_CBasePlayerWeapon_SendWeaponAnim; From c9be608eb890fdfc67ede4f7e18ecbee3b75af47 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sun, 16 Jul 2023 17:53:59 -0400 Subject: [PATCH 05/13] Added new PM_* Hookchains - PM_WaterJump - PM_PlayStepSound - PM_AirAccelerate --- regamedll/dlls/API/CAPI_Impl.cpp | 3 +++ regamedll/dlls/API/CAPI_Impl.h | 12 ++++++++++++ regamedll/pm_shared/pm_shared.cpp | 12 +++++++++--- regamedll/pm_shared/pm_shared.h | 3 +++ regamedll/public/regamedll/regamedll_api.h | 15 +++++++++++++++ 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 5606279d9..1c1e79b2f 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -310,10 +310,13 @@ 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); diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index 2ca0f9368..efb73ecac 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -649,6 +649,10 @@ typedef IHookChainRegistryImpl CReGameHookRegistry_FreeGame typedef IHookChainImpl CReGameHook_PM_LadderMove; typedef IHookChainRegistryImpl CReGameHookRegistry_PM_LadderMove; +// PM_WaterJump hook +typedef IHookChainImpl CReGameHook_PM_WaterJump; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_WaterJump; + // PM_CheckWaterJump hook typedef IHookChainImpl CReGameHook_PM_CheckWaterJump; typedef IHookChainRegistryImpl CReGameHookRegistry_PM_CheckWaterJump; @@ -665,6 +669,14 @@ typedef IHookChainRegistryImpl CReGameHookRegistry_PM_Duck; typedef IHookChainImpl CReGameHook_PM_UnDuck; typedef IHookChainRegistryImpl CReGameHookRegistry_PM_UnDuck; +// PM_PlayStepSound hook +typedef IHookChainImpl CReGameHook_PM_PlayStepSound; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_PlayStepSound; + +// PM_AirAccelerate hook +typedef IHookChainImpl CReGameHook_PM_AirAccelerate; +typedef IHookChainRegistryImpl CReGameHookRegistry_PM_AirAccelerate; + // ClearMultiDamage hook typedef IHookChainImpl CReGameHook_ClearMultiDamage; typedef IHookChainRegistryImpl CReGameHookRegistry_ClearMultiDamage; diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index 55a809936..9ab5684cb 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -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; @@ -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; @@ -2123,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) { diff --git a/regamedll/pm_shared/pm_shared.h b/regamedll/pm_shared/pm_shared.h index f4d80a83b..2c0385f40 100644 --- a/regamedll/pm_shared/pm_shared.h +++ b/regamedll/pm_shared/pm_shared.h @@ -85,10 +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 diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 9bff07002..280ea46bd 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -528,6 +528,10 @@ typedef IHookChainRegistry IReGameHookRegistry_FreeGa typedef IHookChain IReGameHook_PM_LadderMove; typedef IHookChainRegistry IReGameHookRegistry_PM_LadderMove; +// PM_WaterJump hook +typedef IHookChain IReGameHook_PM_WaterJump; +typedef IHookChainRegistry IReGameHookRegistry_PM_WaterJump; + // PM_CheckWaterJump hook typedef IHookChain IReGameHook_PM_CheckWaterJump; typedef IHookChainRegistry IReGameHookRegistry_PM_CheckWaterJump; @@ -544,6 +548,14 @@ typedef IHookChainRegistry IReGameHookRegistry_PM_Duck; typedef IHookChain IReGameHook_PM_UnDuck; typedef IHookChainRegistry IReGameHookRegistry_PM_UnDuck; +// PM_PlayStepSound hook +typedef IHookChain IReGameHook_PM_PlayStepSound; +typedef IHookChainRegistry IReGameHookRegistry_PM_PlayStepSound; + +// PM_AirAccelerate hook +typedef IHookChain IReGameHook_PM_AirAccelerate; +typedef IHookChainRegistry IReGameHookRegistry_PM_AirAccelerate; + // ClearMultiDamage hook typedef IHookChain IReGameHook_ClearMultiDamage; typedef IHookChainRegistry IReGameHookRegistry_ClearMultiDamage; @@ -720,10 +732,13 @@ class IReGameHookchains { 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; From b5e085cb1528dfd87e809f019ca077e9c9b1c83b Mon Sep 17 00:00:00 2001 From: dystopm Date: Sun, 16 Jul 2023 17:57:52 -0400 Subject: [PATCH 06/13] Forgotten members on CAPI_Impl.h --- regamedll/dlls/API/CAPI_Impl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index efb73ecac..2b282988d 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -852,10 +852,13 @@ class CReGameHookchains: public IReGameHookchains { 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; From cb18d4c81b8e9d4ff217a7462dd7a635bbcdd2a7 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sun, 16 Jul 2023 17:59:17 -0400 Subject: [PATCH 07/13] Forgotten virtual decls on CAPI_Impl.h --- regamedll/dlls/API/CAPI_Impl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index 2b282988d..b2af7a5ab 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -1003,10 +1003,13 @@ class CReGameHookchains: public IReGameHookchains { 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(); From b136cb20ad581f421dac4d03e95997fa7bed45d3 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sun, 16 Jul 2023 18:36:47 -0400 Subject: [PATCH 08/13] Added CBasePlayer::CheckTimeBasedDamage --- regamedll/dlls/API/CAPI_Impl.cpp | 1 + regamedll/dlls/API/CAPI_Impl.h | 6 ++++++ regamedll/dlls/player.cpp | 4 +++- regamedll/dlls/player.h | 1 + regamedll/public/regamedll/regamedll_api.h | 5 +++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 1c1e79b2f..87c17589e 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -324,6 +324,7 @@ 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_KickBack); GAMEHOOK_REGISTRY(CBasePlayerWeapon_SendWeaponAnim); diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index b2af7a5ab..da62d48ac 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -705,6 +705,10 @@ typedef IHookChainRegistryClassEmptyImpl CReGameHook_CBotManager_OnEvent; typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CBotManager_OnEvent; +// CBasePlayer::CheckTimeBasedDamage hook +typedef IHookChainClassImpl CReGameHook_CBasePlayer_CheckTimeBasedDamage; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage; + // CBasePlayer::EntSelectSpawnPoint hook typedef IHookChainClassImpl CReGameHook_CBasePlayer_EntSelectSpawnPoint; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; @@ -866,6 +870,7 @@ class CReGameHookchains: public IReGameHookchains { 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_KickBack m_CBasePlayerWeapon_KickBack; CReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim m_CBasePlayerWeapon_SendWeaponAnim; @@ -1017,6 +1022,7 @@ class CReGameHookchains: public IReGameHookchains { 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_KickBack *CBasePlayerWeapon_KickBack(); virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim(); diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 0a6f1a765..48f961f88 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -4784,6 +4784,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. @@ -4792,7 +4794,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; diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index fd4577709..129abd6d1 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -444,6 +444,7 @@ class CBasePlayer: public CBaseMonster { void Pain_OrigFunc(int iLastHitGroup, bool bHasArmour); void DeathSound_OrigFunc(); void JoiningThink_OrigFunc(); + void CheckTimeBasedDamage_OrigFunc(); edict_t *EntSelectSpawnPoint_OrigFunc(); CCSPlayer *CSPlayer() const; diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 280ea46bd..5d1fc3436 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -584,6 +584,10 @@ typedef IHookChainRegistry IReGameHookRe typedef IHookChain IReGameHook_CBotManager_OnEvent; typedef IHookChainRegistry IReGameHookRegistry_CBotManager_OnEvent; +// CBasePlayer::CheckTimeBasedDamage hook +typedef IHookChainClass IReGameHook_CBasePlayer_CheckTimeBasedDamage; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage; + // CBasePlayer::EntSelectSpawnPoint hook typedef IHookChainClass IReGameHook_CBasePlayer_EntSelectSpawnPoint; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; @@ -746,6 +750,7 @@ class IReGameHookchains { 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_KickBack *CBasePlayerWeapon_KickBack() = 0; virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim() = 0; From e651e6bf025093fba3412a3e32bc6190a99c2857 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sun, 16 Jul 2023 18:46:15 -0400 Subject: [PATCH 09/13] Added CBasePlayerWeapon::ItemPostFrame --- regamedll/dlls/API/CAPI_Impl.cpp | 1 + regamedll/dlls/API/CAPI_Impl.h | 6 ++++++ regamedll/dlls/weapons.cpp | 4 +++- regamedll/dlls/weapons.h | 1 + regamedll/public/regamedll/regamedll_api.h | 5 +++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 87c17589e..38966f4bd 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -326,6 +326,7 @@ 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); diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index da62d48ac..1364c8d85 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -713,6 +713,10 @@ typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBase typedef IHookChainClassImpl CReGameHook_CBasePlayer_EntSelectSpawnPoint; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; +// CBasePlayerWeapon::ItemPostFrame hook +typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_ItemPostFrame; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame; + // CBasePlayerWeapon::KickBack hook typedef IHookChainClassImpl CReGameHook_CBasePlayerWeapon_KickBack; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayerWeapon_KickBack; @@ -872,6 +876,7 @@ class CReGameHookchains: public IReGameHookchains { 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; @@ -1024,6 +1029,7 @@ class CReGameHookchains: public IReGameHookchains { 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(); }; diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index a9469311a..977fdbc1a 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -896,7 +896,9 @@ void CBasePlayerWeapon::HandleInfiniteAmmo() } } -void CBasePlayerWeapon::ItemPostFrame() +LINK_HOOK_CLASS_VOID_CHAIN2(ItemPostFrame) + +void EXT_FUNC CBasePlayerWeapon::__API_HOOK(ItemPostFrame)() { int usableButtons = m_pPlayer->pev->button; diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index fb9117732..251b17dcd 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -405,6 +405,7 @@ class CBasePlayerWeapon: public CBasePlayerItem 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 diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 5d1fc3436..3fd8c5960 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -592,6 +592,10 @@ typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlay typedef IHookChainClass IReGameHook_CBasePlayer_EntSelectSpawnPoint; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; +// CBasePlayerWeapon::ItemPostFrame hook +typedef IHookChainClass IReGameHook_CBasePlayerWeapon_ItemPostFrame; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame; + // CBasePlayerWeapon::KickBack hook typedef IHookChainClass IReGameHook_CBasePlayerWeapon_KickBack; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_KickBack; @@ -752,6 +756,7 @@ class IReGameHookchains { 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; }; From 3c763d506c908042da378e1385b166ea4e266a89 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sun, 16 Jul 2023 18:47:12 -0400 Subject: [PATCH 10/13] Typo --- regamedll/dlls/weapons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 977fdbc1a..d1c270d19 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -896,7 +896,7 @@ void CBasePlayerWeapon::HandleInfiniteAmmo() } } -LINK_HOOK_CLASS_VOID_CHAIN2(ItemPostFrame) +LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayerWeapon, ItemPostFrame) void EXT_FUNC CBasePlayerWeapon::__API_HOOK(ItemPostFrame)() { From 7f926ae5bb1d98d510610d76b63cf50e1070681b Mon Sep 17 00:00:00 2001 From: dystopm Date: Sun, 16 Jul 2023 22:46:54 -0400 Subject: [PATCH 11/13] Added BuyItem and CSGameRules::Think --- regamedll/dlls/API/CAPI_Impl.cpp | 2 ++ regamedll/dlls/API/CAPI_Impl.h | 12 ++++++++++++ regamedll/dlls/client.cpp | 4 +++- regamedll/dlls/client.h | 1 + regamedll/dlls/gamerules.h | 1 + regamedll/dlls/multiplay_gamerules.cpp | 6 ++++-- regamedll/public/regamedll/regamedll_api.h | 10 ++++++++++ 7 files changed, 33 insertions(+), 3 deletions(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 38966f4bd..ce4241029 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -320,6 +320,8 @@ 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); diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index 1364c8d85..b6bc45dd0 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -689,6 +689,14 @@ typedef IHookChainRegistryImpl CRe typedef IHookChainImpl CReGameHook_ApplyMultiDamage; typedef IHookChainRegistryImpl CReGameHookRegistry_ApplyMultiDamage; +// BuyItem hook +typedef IHookChainImpl CReGameHook_BuyItem; +typedef IHookChainRegistryImpl CReGameHookRegistry_BuyItem; + +// CHalfLifeMultiplay::Think hook +typedef IHookChainClassImpl CReGameHook_CSGameRules_Think; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_Think; + // CHalfLifeMultiplay::TeamFull hook typedef IHookChainClassImpl CReGameHook_CSGameRules_TeamFull; typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_TeamFull; @@ -870,6 +878,8 @@ class CReGameHookchains: public IReGameHookchains { 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; @@ -1023,6 +1033,8 @@ class CReGameHookchains: public IReGameHookchains { 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(); diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index cd52b7bc3..febe02931 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -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; diff --git a/regamedll/dlls/client.h b/regamedll/dlls/client.h index 28f06e41b..d873bd202 100644 --- a/regamedll/dlls/client.h +++ b/regamedll/dlls/client.h @@ -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); diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index 766c07b0a..00d0116ff 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -570,6 +570,7 @@ class CHalfLifeMultiplay: public CGameRules 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); diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 86ddc81e6..7799e676e 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -2374,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); @@ -4894,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)() diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 3fd8c5960..72cbf13aa 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -568,6 +568,14 @@ typedef IHookChainRegistry IReGame typedef IHookChain IReGameHook_ApplyMultiDamage; typedef IHookChainRegistry IReGameHookRegistry_ApplyMultiDamage; +// BuyItem hook +typedef IHookChain IReGameHook_BuyItem; +typedef IHookChainRegistry IReGameHookRegistry_BuyItem; + +// CHalfLifeMultiplay::Think hook +typedef IHookChain IReGameHook_CSGameRules_Think; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_Think; + // CHalfLifeMultiplay::TeamFull hook typedef IHookChain IReGameHook_CSGameRules_TeamFull; typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_TeamFull; @@ -750,6 +758,8 @@ class IReGameHookchains { 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; From 6c2907890404a5c45601cbf34a73d30c70c3f1fd Mon Sep 17 00:00:00 2001 From: dystopm Date: Tue, 25 Jul 2023 00:55:19 -0400 Subject: [PATCH 12/13] AddAmmoNameToAmmoRegistry refactory --- regamedll/dlls/API/CAPI_Impl.cpp | 4 ++-- regamedll/dlls/weapons.cpp | 28 ++++++++++++---------- regamedll/dlls/weapons.h | 4 ++-- regamedll/public/regamedll/regamedll_api.h | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index ce4241029..792bc3ef0 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -111,9 +111,9 @@ void EXT_FUNC UTIL_Remove_api(CBaseEntity *pEntity) UTIL_Remove(pEntity); } -void EXT_FUNC AddAmmoNameToAmmoRegistry_api(const char *szAmmoname) +int EXT_FUNC AddAmmoNameToAmmoRegistry_api(const char *szAmmoname) { - AddAmmoNameToAmmoRegistry(szAmmoname); + return AddAmmoNameToAmmoRegistry(szAmmoname); } void EXT_FUNC TextureTypePlaySound_api(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType) diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index d1c270d19..c67662cb3 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -214,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; @@ -225,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; } } @@ -233,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) @@ -252,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 @@ -275,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); } } @@ -2650,3 +2651,4 @@ int CBasePlayerItem::iFlags() const { return m_ItemInfoEx.iFlags; } + diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index 251b17dcd..da2c9be6d 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -2165,7 +2165,7 @@ 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); @@ -2174,4 +2174,4 @@ float GetBaseAccuracy(WeaponIdType id); 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 \ No newline at end of file +#endif diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 72cbf13aa..f232a1a7d 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -791,7 +791,7 @@ struct ReGameFuncs_t { void (*UTIL_RemoveOther)(const char *szClassname, int nCount); void (*UTIL_DecalTrace)(TraceResult *pTrace, int decalNumber); void (*UTIL_Remove)(CBaseEntity *pEntity); - void (*AddAmmoNameToAmmoRegistry)(const char *szAmmoname); + 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); From 6d80cce2e85b8da359d6b221cb350ba4109c482a Mon Sep 17 00:00:00 2001 From: Dmitry Novikov Date: Tue, 5 Sep 2023 10:05:35 +0700 Subject: [PATCH 13/13] Bump minor version in an API bump up to 23 --- regamedll/public/regamedll/regamedll_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index f232a1a7d..57da8d290 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 22 +#define REGAMEDLL_API_VERSION_MINOR 23 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn;