mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Added API hook PM_Init, PM_Move, PM_AirMove
This commit is contained in:
parent
bc8dbf056c
commit
ab4a8437ce
@ -55,8 +55,8 @@ typedef IVoidHookChain<struct entvars_s *, float, Vector &, struct TraceResult *
|
||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHookRegistry_CBasePlayer_TraceAttack;
|
||||
|
||||
// CBasePlayer::TakeDamage hook
|
||||
typedef IHookChain<int, struct entvars_s *, struct entvars_s *, float, int> IReGameHook_CBasePlayer_TakeDamage;
|
||||
typedef IHookChainRegistryClass<int, class CBasePlayer, struct entvars_s *, struct entvars_s *, float, int> IReGameHookRegistry_CBasePlayer_TakeDamage;
|
||||
typedef IHookChain<int, struct entvars_s *, struct entvars_s *, float&, int> IReGameHook_CBasePlayer_TakeDamage;
|
||||
typedef IHookChainRegistryClass<int, class CBasePlayer, struct entvars_s *, struct entvars_s *, float&, int> IReGameHookRegistry_CBasePlayer_TakeDamage;
|
||||
|
||||
// CBasePlayer::TakeHealth hook
|
||||
typedef IHookChain<int, float, int> IReGameHook_CBasePlayer_TakeHealth;
|
||||
@ -182,6 +182,18 @@ typedef IHookChainRegistry<bool, class CBasePlayer *, int> IReGameHookRegistry_C
|
||||
typedef IHookChain<class CGameRules *> IReGameHook_InstallGameRules;
|
||||
typedef IHookChainRegistry<class CGameRules *> IReGameHookRegistry_InstallGameRules;
|
||||
|
||||
// PM_Init hook
|
||||
typedef IVoidHookChain<struct playermove_s *> IReGameHook_PM_Init;
|
||||
typedef IVoidHookChainRegistry<struct playermove_s *> IReGameHookRegistry_PM_Init;
|
||||
|
||||
// PM_Move hook
|
||||
typedef IVoidHookChain<struct playermove_s *, int> IReGameHook_PM_Move;
|
||||
typedef IVoidHookChainRegistry<struct playermove_s *, int> IReGameHookRegistry_PM_Move;
|
||||
|
||||
// PM_AirMove hook
|
||||
typedef IVoidHookChain<> IReGameHook_PM_AirMove;
|
||||
typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_AirMove;
|
||||
|
||||
class IReGameHookchains {
|
||||
public:
|
||||
virtual ~IReGameHookchains() {}
|
||||
@ -215,17 +227,17 @@ public:
|
||||
virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem* CBasePlayer_GiveNamedItem() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0;
|
||||
|
||||
|
||||
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0;
|
||||
|
||||
|
||||
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0;
|
||||
virtual IReGameHookRegistry_PlayerBlind* PlayerBlind() = 0;
|
||||
virtual IReGameHookRegistry_RadiusFlash_TraceLine* RadiusFlash_TraceLine() = 0;
|
||||
virtual IReGameHookRegistry_RoundEnd* RoundEnd() = 0;
|
||||
virtual IReGameHookRegistry_CanBuyThis* CanBuyThis() = 0;
|
||||
virtual IReGameHookRegistry_InstallGameRules* InstallGameRules() = 0;
|
||||
virtual IReGameHookRegistry_PM_Init* PM_Init() = 0;
|
||||
virtual IReGameHookRegistry_PM_Move* PM_Move() = 0;
|
||||
virtual IReGameHookRegistry_PM_AirMove* PM_AirMove() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
@ -2076,5 +2076,7 @@ class IReGameData {
|
||||
public:
|
||||
virtual ~IReGameData() {}
|
||||
|
||||
virtual class CGameRules** GetGameRules() = 0;
|
||||
virtual class CGameRules* GetGameRules() = 0;
|
||||
virtual struct WeaponInfoStruct *GetWeaponInfo(int weaponID) = 0;
|
||||
virtual struct playermove_s *GetPlayerMove() = 0;
|
||||
};
|
||||
|
@ -1282,7 +1282,9 @@ void PM_WaterMove()
|
||||
PM_FlyMove();
|
||||
}
|
||||
|
||||
void PM_AirMove()
|
||||
LINK_HOOK_VOID_CHAIN2(PM_AirMove);
|
||||
|
||||
void EXT_FUNC __API_HOOK(PM_AirMove)()
|
||||
{
|
||||
int i;
|
||||
vec3_t wishvel;
|
||||
@ -2579,9 +2581,7 @@ float PM_CalcRoll(vec_t *angles, vec_t *velocity, float rollangle, float rollspe
|
||||
AngleVectors(angles, forward, right, up);
|
||||
|
||||
side = DotProduct(velocity, right);
|
||||
|
||||
sign = side < 0 ? -1 : 1;
|
||||
|
||||
side = Q_fabs(side);
|
||||
|
||||
value = rollangle;
|
||||
@ -3107,11 +3107,13 @@ void PM_CreateStuckTable()
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
// invoked by each side as appropriate. There should be no distinction, internally, between server
|
||||
// and client. This will ensure that prediction behaves appropriately.
|
||||
void EXT_FUNC PM_Move(struct playermove_s *ppmove, int server)
|
||||
void EXT_FUNC __API_HOOK(PM_Move)(struct playermove_s *ppmove, int server)
|
||||
{
|
||||
assert(pm_shared_initialized);
|
||||
|
||||
@ -3150,7 +3152,9 @@ NOXREF int PM_GetPhysEntInfo(int ent)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXT_FUNC PM_Init(struct playermove_s *ppmove)
|
||||
LINK_HOOK_VOID_CHAIN(PM_Init, (struct playermove_s *ppmove), ppmove);
|
||||
|
||||
void EXT_FUNC __API_HOOK(PM_Init)(struct playermove_s *ppmove)
|
||||
{
|
||||
assert(!pm_shared_initialized);
|
||||
|
||||
|
@ -81,6 +81,10 @@ void PM_Init(struct playermove_s *ppmove);
|
||||
void PM_Move(struct playermove_s *ppmove, int server);
|
||||
char PM_FindTextureType(char *name);
|
||||
|
||||
void PM_Init_(struct playermove_s *ppmove);
|
||||
void PM_Move_(struct playermove_s *ppmove, int server);
|
||||
void PM_AirMove_();
|
||||
|
||||
extern struct playermove_s *pmove;
|
||||
|
||||
#endif // PM_SHARED_H
|
||||
|
@ -182,6 +182,18 @@ typedef IHookChainRegistry<bool, class CBasePlayer *, int> IReGameHookRegistry_C
|
||||
typedef IHookChain<class CGameRules *> IReGameHook_InstallGameRules;
|
||||
typedef IHookChainRegistry<class CGameRules *> IReGameHookRegistry_InstallGameRules;
|
||||
|
||||
// PM_Init hook
|
||||
typedef IVoidHookChain<struct playermove_s *> IReGameHook_PM_Init;
|
||||
typedef IVoidHookChainRegistry<struct playermove_s *> IReGameHookRegistry_PM_Init;
|
||||
|
||||
// PM_Move hook
|
||||
typedef IVoidHookChain<struct playermove_s *, int> IReGameHook_PM_Move;
|
||||
typedef IVoidHookChainRegistry<struct playermove_s *, int> IReGameHookRegistry_PM_Move;
|
||||
|
||||
// PM_AirMove hook
|
||||
typedef IVoidHookChain<> IReGameHook_PM_AirMove;
|
||||
typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_AirMove;
|
||||
|
||||
class IReGameHookchains {
|
||||
public:
|
||||
virtual ~IReGameHookchains() {}
|
||||
@ -215,17 +227,17 @@ public:
|
||||
virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem* CBasePlayer_GiveNamedItem() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0;
|
||||
|
||||
|
||||
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0;
|
||||
|
||||
|
||||
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0;
|
||||
virtual IReGameHookRegistry_PlayerBlind* PlayerBlind() = 0;
|
||||
virtual IReGameHookRegistry_RadiusFlash_TraceLine* RadiusFlash_TraceLine() = 0;
|
||||
virtual IReGameHookRegistry_RoundEnd* RoundEnd() = 0;
|
||||
virtual IReGameHookRegistry_CanBuyThis* CanBuyThis() = 0;
|
||||
virtual IReGameHookRegistry_InstallGameRules* InstallGameRules() = 0;
|
||||
virtual IReGameHookRegistry_PM_Init* PM_Init() = 0;
|
||||
virtual IReGameHookRegistry_PM_Move* PM_Move() = 0;
|
||||
virtual IReGameHookRegistry_PM_AirMove* PM_AirMove() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
@ -2078,4 +2078,5 @@ public:
|
||||
|
||||
virtual class CGameRules* GetGameRules() = 0;
|
||||
virtual struct WeaponInfoStruct *GetWeaponInfo(int weaponID) = 0;
|
||||
virtual struct playermove_s *GetPlayerMove() = 0;
|
||||
};
|
||||
|
@ -89,6 +89,9 @@ IReGameHookRegistry_RadiusFlash_TraceLine* CReGameHookchains::RadiusFlash_TraceL
|
||||
IReGameHookRegistry_RoundEnd* CReGameHookchains::RoundEnd() { return &m_RoundEnd; }
|
||||
IReGameHookRegistry_CanBuyThis* CReGameHookchains::CanBuyThis() { return &m_CanBuyThis; }
|
||||
IReGameHookRegistry_InstallGameRules* CReGameHookchains::InstallGameRules() { return &m_InstallGameRules; }
|
||||
IReGameHookRegistry_PM_Init* CReGameHookchains::PM_Init() { return &m_PM_Init; }
|
||||
IReGameHookRegistry_PM_Move* CReGameHookchains::PM_Move() { return &m_PM_Move; }
|
||||
IReGameHookRegistry_PM_AirMove* CReGameHookchains::PM_AirMove() { return &m_PM_AirMove; }
|
||||
|
||||
int CReGameApi::GetMajorVersion()
|
||||
{
|
||||
|
@ -176,6 +176,18 @@ typedef IHookChainRegistryImpl<bool, class CBasePlayer *, int> CReGameHookRegist
|
||||
typedef IHookChainImpl<CGameRules *> CReGameHook_InstallGameRules;
|
||||
typedef IHookChainRegistryImpl<CGameRules *> CReGameHookRegistry_InstallGameRules;
|
||||
|
||||
// PM_Init hook
|
||||
typedef IVoidHookChainImpl<struct playermove_s *> CReGameHook_PM_Init;
|
||||
typedef IVoidHookChainRegistryImpl<struct playermove_s *> CReGameHookRegistry_PM_Init;
|
||||
|
||||
// PM_Move hook
|
||||
typedef IVoidHookChainImpl<struct playermove_s *, int> CReGameHook_PM_Move;
|
||||
typedef IVoidHookChainRegistryImpl<struct playermove_s *, int> CReGameHookRegistry_PM_Move;
|
||||
|
||||
// PM_AirMove hook
|
||||
typedef IVoidHookChainImpl<> CReGameHook_PM_AirMove;
|
||||
typedef IVoidHookChainRegistryImpl<> CReGameHookRegistry_PM_AirMove;
|
||||
|
||||
class CReGameHookchains: public IReGameHookchains {
|
||||
public:
|
||||
// CBasePlayer virtual
|
||||
@ -209,7 +221,6 @@ public:
|
||||
CReGameHookRegistry_CBasePlayer_AddAccount m_CBasePlayer_AddAccount;
|
||||
CReGameHookRegistry_CBasePlayer_GiveShield m_CBasePlayer_GiveShield;
|
||||
|
||||
|
||||
CReGameHookRegistry_CBaseAnimating_ResetSequenceInfo m_CBaseAnimating_ResetSequenceInfo;
|
||||
|
||||
CReGameHookRegistry_GetForceCamera m_GetForceCamera;
|
||||
@ -218,6 +229,9 @@ public:
|
||||
CReGameHookRegistry_RoundEnd m_RoundEnd;
|
||||
CReGameHookRegistry_CanBuyThis m_CanBuyThis;
|
||||
CReGameHookRegistry_InstallGameRules m_InstallGameRules;
|
||||
CReGameHookRegistry_PM_Init m_PM_Init;
|
||||
CReGameHookRegistry_PM_Move m_PM_Move;
|
||||
CReGameHookRegistry_PM_AirMove m_PM_AirMove;
|
||||
|
||||
public:
|
||||
virtual IReGameHookRegistry_CBasePlayer_Spawn* CBasePlayer_Spawn();
|
||||
@ -250,7 +264,6 @@ public:
|
||||
virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount();
|
||||
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield();
|
||||
|
||||
|
||||
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo();
|
||||
|
||||
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera();
|
||||
@ -259,6 +272,9 @@ public:
|
||||
virtual IReGameHookRegistry_RoundEnd* RoundEnd();
|
||||
virtual IReGameHookRegistry_CanBuyThis* CanBuyThis();
|
||||
virtual IReGameHookRegistry_InstallGameRules* InstallGameRules();
|
||||
virtual IReGameHookRegistry_PM_Init* PM_Init();
|
||||
virtual IReGameHookRegistry_PM_Move* PM_Move();
|
||||
virtual IReGameHookRegistry_PM_AirMove* PM_AirMove();
|
||||
|
||||
};
|
||||
|
||||
|
@ -142,3 +142,7 @@ CGameRules* EXT_FUNC CReGameData::GetGameRules() {
|
||||
WeaponInfoStruct* EXT_FUNC CReGameData::GetWeaponInfo(int weaponID) {
|
||||
return ::GetWeaponInfo(weaponID);
|
||||
}
|
||||
|
||||
playermove_t* EXT_FUNC CReGameData::GetPlayerMove() {
|
||||
return pmove;
|
||||
}
|
||||
|
@ -2524,6 +2524,7 @@ class CReGameData: public IReGameData {
|
||||
public:
|
||||
virtual CGameRules* GetGameRules();
|
||||
virtual WeaponInfoStruct *GetWeaponInfo(int weaponID);
|
||||
virtual playermove_t *GetPlayerMove();
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
Loading…
x
Reference in New Issue
Block a user