2
0
mirror of https://github.com/rehlds/reapi.git synced 2025-01-16 00:28:17 +03:00

Update SDK regamedll

This commit is contained in:
s1lentq 2016-06-08 17:21:58 +07:00
parent 848bb10907
commit 28dcc802d4
10 changed files with 148 additions and 87 deletions

View File

@ -90,6 +90,33 @@ enum ScenarioEventEndRound
ROUND_GAME_COMMENCE,
};
enum RewardRules
{
RR_CTS_WIN,
RR_TERRORISTS_WIN,
RR_TARGET_BOMB,
RR_VIP_ESCAPED,
RR_VIP_ASSASSINATED,
RR_TERRORISTS_ESCAPED,
RR_CTS_PREVENT_ESCAPE,
RR_ESCAPING_TERRORISTS_NEUTRALIZED,
RR_BOMB_DEFUSED,
RR_BOMB_PLANTED,
RR_BOMB_EXPLODED,
RR_ALL_HOSTAGES_RESCUED,
RR_TARGET_BOMB_SAVED,
RR_HOSTAGE_NOT_RESCUED,
RR_VIP_NOT_ESCAPED,
RR_LOSER_BONUS_DEFAULT,
RR_LOSER_BONUS_MIN,
RR_LOSER_BONUS_MAX,
RR_LOSER_BONUS_ADD,
RR_RESCUED_HOSTAGE,
RR_TOOK_HOSTAGE_ACC,
RR_TOOK_HOSTAGE,
RR_END
};
// custom enum
enum RewardAccount
{
@ -371,6 +398,23 @@ public:
virtual void GiveC4() = 0;
virtual void ChangeLevel() = 0;
virtual void GoToIntermission() = 0;
// Setup counts for m_iNumTerrorist, m_iNumCT, m_iNumSpawnableTerrorist, m_iNumSpawnableCT, etc.
virtual void InitializePlayerCounts(int &NumAliveTerrorist, int &NumAliveCT, int &NumDeadTerrorist, int &NumDeadCT) = 0;
virtual void BalanceTeams() = 0;
virtual void SwapAllPlayers() = 0;
virtual void UpdateTeamScores() = 0;
virtual void EndRoundMessage(const char *sentence, int event) = 0;
virtual void SetAccountRules(RewardRules rules, int amount) = 0;
// BOMB MAP FUNCTIONS
virtual BOOL IsThereABomber() = 0;
virtual BOOL IsThereABomb() = 0;
virtual bool HasRoundTimeExpired() = 0;
virtual bool IsBombPlanted() = 0;
public:
bool ShouldSkipSpawn() const { return m_bSkipSpawn; }
void MarkSpawnSkipped() { m_bSkipSpawn = false; }
@ -454,7 +498,7 @@ public:
float m_flForceChaseCamValue;
float m_flFadeToBlackValue;
CBasePlayer *m_pVIP;
CBasePlayer *VIPQueue[MAX_VIP_QUEUES];
CBasePlayer *m_pVIPQueue[MAX_VIP_QUEUES];
float m_flIntermissionEndTime;
float m_flIntermissionStartTime;
BOOL m_iEndIntermissionButtonHit;

View File

@ -37,6 +37,16 @@ public:
virtual t_ret callOriginal(t_args... args) = 0;
};
template<typename t_ret, typename t_class, typename ...t_args>
class IHookChainClass {
protected:
virtual ~IHookChainClass() {}
public:
virtual t_ret callNext(t_class *, t_args... args) = 0;
virtual t_ret callOriginal(t_class *, t_args... args) = 0;
};
template<typename ...t_args>
class IVoidHookChain
{
@ -48,6 +58,17 @@ public:
virtual void callOriginal(t_args... args) = 0;
};
template<typename t_class, typename ...t_args>
class IVoidHookChainClass
{
protected:
virtual ~IVoidHookChainClass() {}
public:
virtual void callNext(t_class *, t_args... args) = 0;
virtual void callOriginal(t_class *, t_args... args) = 0;
};
// Hook chain registry(for hooks [un]registration)
template<typename t_ret, typename ...t_args>
class IHookChainRegistry {
@ -62,7 +83,7 @@ public:
template<typename t_ret, typename t_class, typename ...t_args>
class IHookChainRegistryClass {
public:
typedef t_ret(*hookfunc_t)(IHookChain<t_ret, t_args...>*, t_class *, t_args...);
typedef t_ret(*hookfunc_t)(IHookChainClass<t_ret, t_class, t_args...>*, t_class *, t_args...);
virtual void registerHook(hookfunc_t hook) = 0;
virtual void unregisterHook(hookfunc_t hook) = 0;
@ -82,7 +103,7 @@ public:
template<typename t_class, typename ...t_args>
class IVoidHookChainRegistryClass {
public:
typedef void(*hookfunc_t)(IVoidHookChain<t_args...>*, t_class *, t_args...);
typedef void(*hookfunc_t)(IVoidHookChainClass<t_class, t_args...>*, t_class *, t_args...);
virtual void registerHook(hookfunc_t hook) = 0;
virtual void unregisterHook(hookfunc_t hook) = 0;

View File

@ -67,13 +67,15 @@
// NOTE: It works for CZ
#define MONEY_BLINK_AMOUNT 30
// Player physics flags bits
// CBasePlayer::m_afPhysicsFlags
#define PFLAG_ONLADDER (1<<0)
#define PFLAG_ONSWING (1<<0)
#define PFLAG_ONTRAIN (1<<1)
#define PFLAG_ONBARNACLE (1<<2)
#define PFLAG_DUCKING (1<<3)
#define PFLAG_USING (1<<4)
#define PFLAG_OBSERVER (1<<5)
#define PFLAG_DUCKING (1<<3) // In the process of ducking, but totally squatted yet
#define PFLAG_USING (1<<4) // Using a continuous entity
#define PFLAG_OBSERVER (1<<5) // player is locked in stationary cam mode. Spectators can move, observers can't.
#define TRAIN_OFF 0x00
#define TRAIN_NEUTRAL 0x01
@ -215,7 +217,6 @@ enum JoinState
SHOWTEAMSELECT,
PICKINGTEAM,
GETINTOGAME
};
enum TrackCommands
@ -229,7 +230,6 @@ enum TrackCommands
CMD_LISTPLAYERS,
CMD_NIGHTVISION,
COMMANDS_TO_TRACK,
};
struct RebuyStruct
@ -244,7 +244,6 @@ struct RebuyStruct
int m_defuser;
int m_nightVision;
int m_armor;
};
enum ThrowDirection
@ -256,7 +255,6 @@ enum ThrowDirection
THROW_BOMB,
THROW_GRENADE,
THROW_HITVEL_MINUS_AIRVEL
};
enum sbar_data

View File

@ -33,138 +33,134 @@
#include "player.h"
#include "gamerules.h"
#define REGAMEDLL_API_VERSION_MAJOR 2
#define REGAMEDLL_API_VERSION_MAJOR 3
#define REGAMEDLL_API_VERSION_MINOR 1
// CBasePlayer::Spawn hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_Spawn;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Spawn;
// CBasePlayer::Precache hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_Precache;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Precache;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Precache;
// CBasePlayer::ObjectCaps hook
typedef IHookChain<int> IReGameHook_CBasePlayer_ObjectCaps;
typedef IHookChainClass<int, class CBasePlayer> IReGameHook_CBasePlayer_ObjectCaps;
typedef IHookChainRegistryClass<int, class CBasePlayer> IReGameHookRegistry_CBasePlayer_ObjectCaps;
// CBasePlayer::Classify hook
typedef IHookChain<int> IReGameHook_CBasePlayer_Classify;
typedef IHookChainClass<int, class CBasePlayer> IReGameHook_CBasePlayer_Classify;
typedef IHookChainRegistryClass<int, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Classify;
// CBasePlayer::TraceAttack hook
typedef IVoidHookChain<struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHook_CBasePlayer_TraceAttack;
typedef IVoidHookChainClass<class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHook_CBasePlayer_TraceAttack;
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 IHookChainClass<int, class CBasePlayer, 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;
typedef IHookChainClass<int, class CBasePlayer, float, int> IReGameHook_CBasePlayer_TakeHealth;
typedef IHookChainRegistryClass<int, class CBasePlayer, float, int> IReGameHookRegistry_CBasePlayer_TakeHealth;
// CBasePlayer::Killed hook
typedef IVoidHookChain<struct entvars_s *, int> IReGameHook_CBasePlayer_Killed;
typedef IVoidHookChainClass<class CBasePlayer, struct entvars_s *, int> IReGameHook_CBasePlayer_Killed;
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, int> IReGameHookRegistry_CBasePlayer_Killed;
// CBasePlayer::AddPoints hook
typedef IVoidHookChain<int, BOOL> IReGameHook_CBasePlayer_AddPoints;
typedef IVoidHookChainClass<class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPoints;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPoints;
// CBasePlayer::AddPointsToTeam hook
typedef IVoidHookChain<int, BOOL> IReGameHook_CBasePlayer_AddPointsToTeam;
typedef IVoidHookChainClass<class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPointsToTeam;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPointsToTeam;
// CBasePlayer::AddPlayerItem hook
typedef IHookChain<BOOL, class CBasePlayerItem *> IReGameHook_CBasePlayer_AddPlayerItem;
typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHook_CBasePlayer_AddPlayerItem;
typedef IHookChainRegistryClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHookRegistry_CBasePlayer_AddPlayerItem;
// CBasePlayer::RemovePlayerItem hook
typedef IHookChain<BOOL, class CBasePlayerItem *> IReGameHook_CBasePlayer_RemovePlayerItem;
typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHook_CBasePlayer_RemovePlayerItem;
typedef IHookChainRegistryClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHookRegistry_CBasePlayer_RemovePlayerItem;
// CBasePlayer::GiveAmmo hook
typedef IHookChain<int, int , char *, int> IReGameHook_CBasePlayer_GiveAmmo;
typedef IHookChainClass<int, class CBasePlayer, int , char *, int> IReGameHook_CBasePlayer_GiveAmmo;
typedef IHookChainRegistryClass<int, class CBasePlayer, int , char *, int> IReGameHookRegistry_CBasePlayer_GiveAmmo;
// CBasePlayer::ResetMaxSpeed hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_ResetMaxSpeed;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ResetMaxSpeed;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ResetMaxSpeed;
// CBasePlayer::Jump hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_Jump;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Jump;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Jump;
// CBasePlayer::Duck hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_Duck;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Duck;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Duck;
// CBasePlayer::PreThink hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_PreThink;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_PreThink;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PreThink;
// CBasePlayer::PostThink hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_PostThink;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_PostThink;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PostThink;
// CBasePlayer::UpdateClientData hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_UpdateClientData;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_UpdateClientData;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_UpdateClientData;
// CBasePlayer::ImpulseCommands hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_ImpulseCommands;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ImpulseCommands;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ImpulseCommands;
// CBasePlayer::RoundRespawn hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_RoundRespawn;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_RoundRespawn;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_RoundRespawn;
// CBasePlayer::Blind hook
typedef IVoidHookChain<float, float, float, int> IReGameHook_CBasePlayer_Blind;
typedef IVoidHookChainClass<class CBasePlayer, float, float, float, int> IReGameHook_CBasePlayer_Blind;
typedef IVoidHookChainRegistryClass<class CBasePlayer, float, float, float, int> IReGameHookRegistry_CBasePlayer_Blind;
// CBasePlayer::Observer_IsValidTarget hook
typedef IHookChain<class CBasePlayer *, int, bool> IReGameHook_CBasePlayer_Observer_IsValidTarget;
typedef IHookChainClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHook_CBasePlayer_Observer_IsValidTarget;
typedef IHookChainRegistryClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget;
// CBasePlayer::SetAnimation hook
typedef IVoidHookChain<PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation;
typedef IVoidHookChainClass<class CBasePlayer, PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation;
typedef IVoidHookChainRegistryClass<class CBasePlayer, PLAYER_ANIM> IReGameHookRegistry_CBasePlayer_SetAnimation;
// CBasePlayer::GiveDefaultItems hook
typedef IVoidHookChain<> IReGameHook_CBasePlayer_GiveDefaultItems;
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_GiveDefaultItems;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_GiveDefaultItems;
// CBasePlayer::GiveNamedItem hook
typedef IVoidHookChain<const char *> IReGameHook_CBasePlayer_GiveNamedItem;
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_GiveNamedItem;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_GiveNamedItem;
// CBasePlayer::AddAccount hook
typedef IVoidHookChain<int, RewardType, bool> IReGameHook_CBasePlayer_AddAccount;
typedef IVoidHookChainClass<class CBasePlayer, int, RewardType, bool> IReGameHook_CBasePlayer_AddAccount;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, RewardType, bool> IReGameHookRegistry_CBasePlayer_AddAccount;
// CBasePlayer::GiveShield hook
typedef IVoidHookChain<bool> IReGameHook_CBasePlayer_GiveShield;
typedef IVoidHookChainClass<class CBasePlayer, bool> IReGameHook_CBasePlayer_GiveShield;
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_GiveShield;
// CBasePlayer:SetClientUserInfoModel hook
typedef IVoidHookChain<char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoModel;
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoModel;
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel;
// CBasePlayer:SetClientUserInfoName hook
typedef IVoidHookChain<char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName;
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName;
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoName;
// CBaseAnimating::ResetSequenceInfo hook
typedef IVoidHookChain<> IReGameHook_CBaseAnimating_ResetSequenceInfo;
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
// GetForceCamera hook
typedef IHookChain<int, class CBasePlayer *> IReGameHook_GetForceCamera;
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_GetForceCamera;
@ -339,6 +335,7 @@ public:
virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CBasePlayer_SetClientUserInfoModel() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CBasePlayer_SetClientUserInfoName() = 0;
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0;
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0;
@ -377,9 +374,6 @@ public:
virtual IReGameHookRegistry_CSGameRules_ChangeLevel* CSGameRules_ChangeLevel() = 0;
virtual IReGameHookRegistry_CSGameRules_GoToIntermission* CSGameRules_GoToIntermission() = 0;
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams() = 0;
// later sort them on the positions and change the major version
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CBasePlayer_SetClientUserInfoName() = 0;
};
struct ReGameFuncs_t {
@ -393,7 +387,6 @@ struct ReGameFuncs_t {
void (*ApplyMultiDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker);
void (*AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
void (*EndRoundMessage)(const char *sentence, int event);
class CBaseEntity *(*UTIL_FindEntityByString)(class CBaseEntity *pStartEntity, const char *szKeyword, const char *szValue);
};

View File

@ -49,10 +49,12 @@ class CCSMonster: public CCSToggle {};
class CCSWeaponBox: public CCSEntity {};
class CCSArmoury: public CCSEntity {};
#pragma warning(disable:4351) // new behavior: elements of array 'CCSPlayer::m_szModel' will be default initialized
class CCSPlayer: public CCSMonster {
public:
CCSPlayer() : m_szModel() {}
CCSPlayer()
{
m_szModel[0] = '\0';
}
virtual bool IsConnected() const;
virtual void SetAnimation(PLAYER_ANIM playerAnim);

View File

@ -52,7 +52,7 @@ void CBasePlayer_Spawn(IReGameHook_CBasePlayer_Spawn *chain, CBasePlayer *pthis)
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_Spawn, original, indexOfEdict(pthis->pev));
@ -62,7 +62,7 @@ void CBasePlayer_Precache(IReGameHook_CBasePlayer_Precache *chain, CBasePlayer *
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_Precache, original, indexOfEdict(pthis->pev));
@ -72,7 +72,7 @@ int CBasePlayer_ObjectCaps(IReGameHook_CBasePlayer_ObjectCaps *chain, CBasePlaye
{
auto original = [chain](int _pthis)
{
return chain->callNext();
return chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
return callForward<int>(RG_CBasePlayer_ObjectCaps, original, indexOfEdict(pthis->pev));
@ -82,7 +82,7 @@ int CBasePlayer_Classify(IReGameHook_CBasePlayer_Classify *chain, CBasePlayer *p
{
auto original = [chain](int _pthis)
{
return chain->callNext();
return chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
return callForward<int>(RG_CBasePlayer_Classify, original, indexOfEdict(pthis->pev));
@ -94,7 +94,7 @@ void CBasePlayer_TraceAttack(IReGameHook_CBasePlayer_TraceAttack *chain, CBasePl
auto original = [chain, &vecDirCopy](int _pthis, int _pevAttacker, float _flDamage, cell _vecDir, TraceResult *_ptr, int _bitsDamageType)
{
chain->callNext(PEV(_pevAttacker), _flDamage, vecDirCopy, _ptr, _bitsDamageType);
chain->callNext(getPrivate<CBasePlayer>(_pthis), PEV(_pevAttacker), _flDamage, vecDirCopy, _ptr, _bitsDamageType);
};
callVoidForward(RG_CBasePlayer_TraceAttack, original, indexOfEdict(pthis->pev), indexOfEdict(pevAttacker), flDamage, g_amxxapi.PrepareCellArrayA(reinterpret_cast<cell *>(&vecDirCopy), 3, true), ptr, bitsDamageType);
@ -104,7 +104,7 @@ int CBasePlayer_TakeDamage(IReGameHook_CBasePlayer_TakeDamage *chain, CBasePlaye
{
auto original = [chain](int _pthis, int _pevInflictor, int _pevAttacker, volatile float& _flDamage, int _bitsDamageType)
{
return chain->callNext(PEV(_pevInflictor), PEV(_pevAttacker), const_cast<float&>(_flDamage), _bitsDamageType);
return chain->callNext(getPrivate<CBasePlayer>(_pthis), PEV(_pevInflictor), PEV(_pevAttacker), const_cast<float&>(_flDamage), _bitsDamageType);
};
return callForward<int>(RG_CBasePlayer_TakeDamage, original, indexOfEdict(pthis->pev), indexOfEdict(pevInflictor), indexOfEdict(pevAttacker), flDamage, bitsDamageType);
@ -114,7 +114,7 @@ int CBasePlayer_TakeHealth(IReGameHook_CBasePlayer_TakeHealth *chain, CBasePlaye
{
auto original = [chain](int _pthis, float _flHealth, int _bitsDamageType)
{
return chain->callNext(_flHealth, _bitsDamageType);
return chain->callNext(getPrivate<CBasePlayer>(_pthis), _flHealth, _bitsDamageType);
};
return callForward<int>(RG_CBasePlayer_TakeHealth, original, indexOfEdict(pthis->pev), flHealth, bitsDamageType);
@ -124,7 +124,7 @@ void CBasePlayer_Killed(IReGameHook_CBasePlayer_Killed *chain, CBasePlayer *pthi
{
auto original = [chain](int _pthis, int _pevAttacker, int _iGib)
{
chain->callNext(PEV(_pevAttacker), _iGib);
chain->callNext(getPrivate<CBasePlayer>(_pthis), PEV(_pevAttacker), _iGib);
};
callVoidForward(RG_CBasePlayer_Killed, original, indexOfEdict(pthis->pev), indexOfEdict(pevAttacker), iGib);
@ -134,7 +134,7 @@ void CBasePlayer_AddPoints(IReGameHook_CBasePlayer_AddPoints *chain, CBasePlayer
{
auto original = [chain](int _pthis, int _score, BOOL _bAllowNegativeScore)
{
chain->callNext(_score, _bAllowNegativeScore);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _score, _bAllowNegativeScore);
};
callVoidForward(RG_CBasePlayer_AddPoints, original, indexOfEdict(pthis->pev), score, bAllowNegativeScore);
@ -144,7 +144,7 @@ void CBasePlayer_AddPointsToTeam(IReGameHook_CBasePlayer_AddPointsToTeam *chain,
{
auto original = [chain](int _pthis, int _score, BOOL _bAllowNegativeScore)
{
chain->callNext(_score, _bAllowNegativeScore);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _score, _bAllowNegativeScore);
};
callVoidForward(RG_CBasePlayer_AddPointsToTeam, original, indexOfEdict(pthis->pev), score, bAllowNegativeScore);
@ -154,7 +154,7 @@ BOOL CBasePlayer_AddPlayerItem(IReGameHook_CBasePlayer_AddPlayerItem *chain, CBa
{
auto original = [chain](int _pthis, int _pItem)
{
return chain->callNext(getPrivate<CBasePlayerItem>(_pItem));
return chain->callNext(getPrivate<CBasePlayer>(_pthis), getPrivate<CBasePlayerItem>(_pItem));
};
return callForward<BOOL>(RG_CBasePlayer_AddPlayerItem, original, indexOfEdict(pthis->pev), indexOfEdict(pItem->pev));
@ -164,7 +164,7 @@ BOOL CBasePlayer_RemovePlayerItem(IReGameHook_CBasePlayer_RemovePlayerItem *chai
{
auto original = [chain](int _pthis, int _pItem)
{
return chain->callNext(getPrivate<CBasePlayerItem>(_pItem));
return chain->callNext(getPrivate<CBasePlayer>(_pthis), getPrivate<CBasePlayerItem>(_pItem));
};
return callForward<BOOL>(RG_CBasePlayer_RemovePlayerItem, original, indexOfEdict(pthis->pev), indexOfEdict(pItem->pev));
@ -174,7 +174,7 @@ int CBasePlayer_GiveAmmo(IReGameHook_CBasePlayer_GiveAmmo *chain, CBasePlayer *p
{
auto original = [chain](int _pthis, int _iAmount, char *_szName, int _iMax)
{
return chain->callNext(_iAmount, _szName, _iMax);
return chain->callNext(getPrivate<CBasePlayer>(_pthis), _iAmount, _szName, _iMax);
};
return callForward<int>(RG_CBasePlayer_GiveAmmo, original, indexOfEdict(pthis->pev), iAmount, szName, iMax);
@ -184,7 +184,7 @@ void CBasePlayer_ResetMaxSpeed(IReGameHook_CBasePlayer_ResetMaxSpeed *chain, CBa
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_ResetMaxSpeed, original, indexOfEdict(pthis->pev));
@ -194,7 +194,7 @@ void CBasePlayer_Jump(IReGameHook_CBasePlayer_Jump *chain, CBasePlayer *pthis)
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_Jump, original, indexOfEdict(pthis->pev));
@ -204,7 +204,7 @@ void CBasePlayer_Duck(IReGameHook_CBasePlayer_Duck *chain, CBasePlayer *pthis)
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_Duck, original, indexOfEdict(pthis->pev));
@ -214,7 +214,7 @@ void CBasePlayer_PreThink(IReGameHook_CBasePlayer_PreThink *chain, CBasePlayer *
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_PreThink, original, indexOfEdict(pthis->pev));
@ -224,7 +224,7 @@ void CBasePlayer_PostThink(IReGameHook_CBasePlayer_PostThink *chain, CBasePlayer
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_PostThink, original, indexOfEdict(pthis->pev));
@ -234,7 +234,7 @@ void CBasePlayer_UpdateClientData(IReGameHook_CBasePlayer_UpdateClientData *chai
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_UpdateClientData, original, indexOfEdict(pthis->pev));
@ -244,7 +244,7 @@ void CBasePlayer_ImpulseCommands(IReGameHook_CBasePlayer_ImpulseCommands *chain,
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_ImpulseCommands, original, indexOfEdict(pthis->pev));
@ -254,7 +254,7 @@ void CBasePlayer_RoundRespawn(IReGameHook_CBasePlayer_RoundRespawn *chain, CBase
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_RoundRespawn, original, indexOfEdict(pthis->pev));
@ -264,7 +264,7 @@ void CBasePlayer_Blind(IReGameHook_CBasePlayer_Blind *chain, CBasePlayer *pthis,
{
auto original = [chain](int _pthis, float _flUntilTime, float _flHoldTime, float _flFadeTime, int _iAlpha)
{
chain->callNext(_flUntilTime, _flHoldTime, _flFadeTime, _iAlpha);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _flUntilTime, _flHoldTime, _flFadeTime, _iAlpha);
};
callVoidForward(RG_CBasePlayer_Blind, original, indexOfEdict(pthis->pev), flUntilTime, flHoldTime, flFadeTime, iAlpha);
@ -274,7 +274,7 @@ CBasePlayer *CBasePlayer_Observer_IsValidTarget(IReGameHook_CBasePlayer_Observer
{
auto original = [chain](int _pthis, int _iPlayerIndex, bool _bSameTeam)
{
return indexOfEdict(chain->callNext(_iPlayerIndex, _bSameTeam)->pev);
return indexOfEdict(chain->callNext(getPrivate<CBasePlayer>(_pthis), _iPlayerIndex, _bSameTeam)->pev);
};
return getPrivate<CBasePlayer>(callForward<size_t>(RG_CBasePlayer_Observer_IsValidTarget, original, indexOfEdict(pthis->pev), iPlayerIndex, bSameTeam));
@ -284,7 +284,7 @@ void CBasePlayer_SetAnimation(IReGameHook_CBasePlayer_SetAnimation *chain, CBase
{
auto original = [chain](int _pthis, PLAYER_ANIM _playerAnim)
{
chain->callNext(_playerAnim);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _playerAnim);
};
callVoidForward(RG_CBasePlayer_SetAnimation, original, indexOfEdict(pthis->pev), playerAnim);
@ -294,7 +294,7 @@ void CBasePlayer_GiveDefaultItems(IReGameHook_CBasePlayer_GiveDefaultItems *chai
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_GiveDefaultItems, original, indexOfEdict(pthis->pev));
@ -304,7 +304,7 @@ void CBasePlayer_GiveNamedItem(IReGameHook_CBasePlayer_GiveNamedItem *chain, CBa
{
auto original = [chain](int _pthis, const char *_pszName)
{
chain->callNext(_pszName);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _pszName);
};
callVoidForward(RG_CBasePlayer_GiveNamedItem, original, indexOfEdict(pthis->pev), pszName);
@ -314,7 +314,7 @@ void CBasePlayer_AddAccount(IReGameHook_CBasePlayer_AddAccount *chain, CBasePlay
{
auto original = [chain](int _pthis, int _amount, RewardType _type, bool _bTrackChange)
{
chain->callNext(_amount, _type, _bTrackChange);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _amount, _type, _bTrackChange);
};
callVoidForward(RG_CBasePlayer_AddAccount, original, indexOfEdict(pthis->pev), amount, type, bTrackChange);
@ -324,7 +324,7 @@ void CBasePlayer_GiveShield(IReGameHook_CBasePlayer_GiveShield *chain, CBasePlay
{
auto original = [chain](int _pthis, bool _bDeploy)
{
chain->callNext(_bDeploy);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _bDeploy);
};
callVoidForward(RG_CBasePlayer_GiveShield, original, indexOfEdict(pthis->pev), bDeploy);
@ -334,7 +334,7 @@ void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceIn
{
auto original = [chain](int _pthis)
{
chain->callNext();
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBaseAnimating_ResetSequenceInfo, original, indexOfEdict(pthis->pev));
@ -638,7 +638,7 @@ void CBasePlayer_SetClientUserInfoModel(IReGameHook_CBasePlayer_SetClientUserInf
{
auto original = [chain](int _pthis, char *_infobuffer, char *_szNewModel)
{
chain->callNext(_infobuffer, _szNewModel);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _infobuffer, _szNewModel);
};
callVoidForward(RG_CBasePlayer_SetClientUserInfoModel, original, indexOfEdict(pthis->pev), infobuffer, szNewModel);
@ -648,7 +648,7 @@ void CBasePlayer_SetClientUserInfoName(IReGameHook_CBasePlayer_SetClientUserInfo
{
auto original = [chain](int _pthis, char *_infobuffer, char *_szNewName)
{
chain->callNext(_infobuffer, _szNewName);
chain->callNext(getPrivate<CBasePlayer>(_pthis), _infobuffer, _szNewName);
};
callVoidForward(RG_CBasePlayer_SetClientUserInfoName, original, indexOfEdict(pthis->pev), infobuffer, szNewName);

View File

@ -74,7 +74,10 @@ int DispatchSpawn(edict_t* pEntity)
g_szMapName[sizeof(g_szMapName) - 1] = '\0';
g_pEdicts = g_engfuncs.pfnPEntityOfEntIndex(0);
g_pMove = g_ReGameApi->GetPlayerMove();
if (api_cfg.hasReGameDLL()) {
g_pMove = g_ReGameApi->GetPlayerMove();
}
g_pFunctionTable->pfnSpawn = nullptr;
RETURN_META_VALUE(MRES_IGNORED, 0);
}

View File

@ -153,7 +153,7 @@ member_t memberlist_gamerules[] = {
GM_MEMBERS(m_flForceChaseCamValue),
GM_MEMBERS(m_flFadeToBlackValue),
GM_MEMBERS(m_pVIP),
GM_MEMBERS(VIPQueue),
GM_MEMBERS(m_pVIPQueue),
GM_MEMBERS(m_flIntermissionEndTime),
GM_MEMBERS(m_flIntermissionStartTime),
GM_MEMBERS(m_iEndIntermissionButtonHit),

View File

@ -130,7 +130,7 @@ enum CSGameRules_Members
m_flForceChaseCamValue,
m_flFadeToBlackValue,
m_pVIP,
VIPQueue,
m_pVIPQueue,
m_flIntermissionEndTime,
m_flIntermissionStartTime,
m_iEndIntermissionButtonHit,

View File

@ -420,7 +420,7 @@ cell AMX_NATIVE_CALL rg_round_end(AMX *amx, cell *params)
Broadcast(_sentence);
if (_message[0])
g_ReGameFuncs->EndRoundMessage(_message, event);
CSGameRules()->EndRoundMessage(_message, event);
CSGameRules()->TerminateRound(CAmxArg(amx, params[arg_delay]), winstatus);
return TRUE;