mirror of
https://github.com/rei-2/Amalgam
synced 2026-10-10 12:53:10 +08:00
Inline some class stuff
This commit is contained in:
@@ -544,7 +544,6 @@
|
||||
<ClCompile Include="src\Hooks\IPanel_PaintTraverse.cpp" />
|
||||
<ClCompile Include="src\Hooks\RecvProxy_SimulationTime.cpp" />
|
||||
<ClCompile Include="src\Hooks\R_DrawSkyBox.cpp" />
|
||||
<ClCompile Include="src\Hooks\S_StartDynamicSound.cpp" />
|
||||
<ClCompile Include="src\Hooks\TF_IsHolidayActive.cpp" />
|
||||
<ClCompile Include="src\Hooks\VGuiMenuBuilder_AddMenuItem.cpp" />
|
||||
<ClCompile Include="src\Hooks\CViewRender_LevelInit.cpp" />
|
||||
|
||||
@@ -138,7 +138,6 @@
|
||||
<ClCompile Include="src\Hooks\IVEngineClient_ClientCmd_Unrestricted.cpp" />
|
||||
<ClCompile Include="src\Hooks\FX_FireBullets.cpp" />
|
||||
<ClCompile Include="src\Hooks\NotificationQueue_Add.cpp" />
|
||||
<ClCompile Include="src\Hooks\S_StartDynamicSound.cpp" />
|
||||
<ClCompile Include="src\Hooks\VGuiMenuBuilder_AddMenuItem.cpp" />
|
||||
<ClCompile Include="src\Hooks\IInput_GetUserCmd.cpp" />
|
||||
<ClCompile Include="src\Hooks\CTFPlayer_IsPlayerClass.cpp" />
|
||||
|
||||
+5
-5
@@ -36,25 +36,25 @@ namespace MAKE_INTERFACE_SCOPE \
|
||||
{\
|
||||
inline InterfaceInit_t name##InterfaceInit_t(reinterpret_cast<void **>(&I::name), dll, signature, offset, deref, true); \
|
||||
}
|
||||
#define NETVAR(_name, type, table, name) type& _name() \
|
||||
#define NETVAR(_name, type, table, name) inline type& _name() \
|
||||
{ \
|
||||
static int nOffset = U::NetVars.GetNetVar(table, name); \
|
||||
return *reinterpret_cast<type*>(uintptr_t(this) + nOffset); \
|
||||
}
|
||||
#define NETVAR_OFF(_name, type, table, name, offset) type& _name() \
|
||||
#define NETVAR_OFF(_name, type, table, name, offset) inline type& _name() \
|
||||
{ \
|
||||
static int nOffset = U::NetVars.GetNetVar(table, name) + offset; \
|
||||
return *reinterpret_cast<type*>(uintptr_t(this) + nOffset); \
|
||||
}
|
||||
#define OFFSET(name, type, offset) type& name() \
|
||||
#define OFFSET(name, type, offset) inline type& name() \
|
||||
{ \
|
||||
return *reinterpret_cast<type*>(uintptr_t(this) + offset); \
|
||||
}
|
||||
#define VIRTUAL(name, type, fn, base, index) type name() \
|
||||
#define VIRTUAL(name, type, fn, base, index) inline type name() \
|
||||
{ \
|
||||
return reinterpret_cast<fn>(U::Memory.GetVFunc(base, index))(base); \
|
||||
}
|
||||
#define CONDGET(name, conditions, cond) bool name() \
|
||||
#define CONDGET(name, conditions, cond) inline bool name() \
|
||||
{ \
|
||||
return (conditions & cond); \
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
|
||||
NETVAR_OFF(GetModelPtr, CStudioHdr*, "CBaseAnimating", "m_nMuzzleFlashParity", 12);
|
||||
|
||||
int GetHitboxGroup(int nHitbox)
|
||||
inline int GetHitboxGroup(int nHitbox)
|
||||
{
|
||||
auto pModel = GetModel();
|
||||
if (!pModel) return -1;
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
return pBox->group;
|
||||
}
|
||||
|
||||
int GetNumOfHitboxes()
|
||||
inline int GetNumOfHitboxes()
|
||||
{
|
||||
auto pModel = GetModel();
|
||||
if (!pModel) return 0;
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
return pSet->numhitboxes;
|
||||
}
|
||||
|
||||
Vec3 GetHitboxOrigin(int nHitbox, Vec3 vOffset = {})
|
||||
inline Vec3 GetHitboxOrigin(int nHitbox, Vec3 vOffset = {})
|
||||
{
|
||||
auto pModel = GetModel();
|
||||
if (!pModel) return {};
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
return vOut;
|
||||
}
|
||||
|
||||
Vec3 GetHitboxCenter(int nHitbox, Vec3 vOffset = {})
|
||||
inline Vec3 GetHitboxCenter(int nHitbox, Vec3 vOffset = {})
|
||||
{
|
||||
auto pModel = GetModel();
|
||||
if (!pModel) return {};
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
return vOut;
|
||||
}
|
||||
|
||||
void GetHitboxInfo(int nHitbox, Vec3* pCenter = nullptr, Vec3* pMins = nullptr, Vec3* pMaxs = nullptr, matrix3x4* pMatrix = nullptr, Vec3 vOffset = {})
|
||||
inline void GetHitboxInfo(int nHitbox, Vec3* pCenter = nullptr, Vec3* pMins = nullptr, Vec3* pMaxs = nullptr, matrix3x4* pMatrix = nullptr, Vec3 vOffset = {})
|
||||
{
|
||||
auto pModel = GetModel();
|
||||
if (!pModel) return;
|
||||
@@ -127,29 +127,29 @@ public:
|
||||
memcpy(*pMatrix, aBones[pBox->bone], sizeof(matrix3x4));
|
||||
}
|
||||
|
||||
std::array<float, 24>& m_flPoseParameter()
|
||||
inline std::array<float, 24>& m_flPoseParameter()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseAnimating", "m_flPoseParameter");
|
||||
return *reinterpret_cast<std::array<float, 24>*>(uintptr_t(this) + nOffset);
|
||||
}
|
||||
|
||||
CUtlVector<matrix3x4>* GetCachedBoneData()
|
||||
inline CUtlVector<matrix3x4>* GetCachedBoneData()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseAnimating", "m_hLightingOrigin") - 88;
|
||||
return reinterpret_cast<CUtlVector<matrix3x4>*>(uintptr_t(this) + nOffset);
|
||||
}
|
||||
|
||||
float FrameAdvance(float flInterval)
|
||||
inline float FrameAdvance(float flInterval)
|
||||
{
|
||||
return S::CBaseAnimating_FrameAdvance.As<float(__fastcall*)(void*, float)>()(this, flInterval);
|
||||
}
|
||||
|
||||
void GetBonePosition(int iBone, Vector& origin, QAngle& angles)
|
||||
inline void GetBonePosition(int iBone, Vector& origin, QAngle& angles)
|
||||
{
|
||||
S::CBaseAnimating_GetBonePosition.As<void(__fastcall*)(void*, int, Vector&, QAngle&)>()(this, iBone, origin, angles);
|
||||
}
|
||||
|
||||
__inline bool GetAttachment(int number, Vec3& origin)
|
||||
inline bool GetAttachment(int number, Vec3& origin)
|
||||
{
|
||||
return reinterpret_cast<bool(__fastcall*)(void*, int, Vec3&)>(U::Memory.GetVFunc(this, 71))(this, number, origin);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public:
|
||||
NETVAR(m_hMyWeapons, EHANDLE, "CBaseCombatCharacter", "m_hMyWeapons");
|
||||
NETVAR(m_bGlowEnabled, bool, "CBaseCombatCharacter", "m_bGlowEnabled");
|
||||
|
||||
__inline size_t* GetMyWeapons()
|
||||
inline size_t* GetMyWeapons()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseCombatCharacter", "m_hMyWeapons");
|
||||
return reinterpret_cast<size_t*>(uintptr_t(this) + nOffset);
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
|
||||
VIRTUAL(GetName, const char*, const char* (__fastcall*)(void*), this, 332);
|
||||
|
||||
bool HasAmmo()
|
||||
inline bool HasAmmo()
|
||||
{
|
||||
return S::CBaseCombatWeapon_HasAmmo.As<bool(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
@@ -94,19 +94,19 @@ public:
|
||||
|
||||
VIRTUAL(UpdateVisibility, void, void(__fastcall*)(CBaseEntity*), this, 91);
|
||||
|
||||
Vec3 GetCenter()
|
||||
inline Vec3 GetCenter()
|
||||
{
|
||||
return m_vecOrigin() + Vec3(0, 0, (m_vecMins().z + m_vecMaxs().z) / 2);
|
||||
}
|
||||
|
||||
Vec3 GetRenderCenter()
|
||||
inline Vec3 GetRenderCenter()
|
||||
{
|
||||
Vec3 vMin = {}, vMax = {};
|
||||
GetRenderBounds(vMin, vMax);
|
||||
return GetRenderOrigin() + Vec3(0.f, 0.f, (vMin.z + vMax.z) / 2);
|
||||
}
|
||||
|
||||
bool IsInValidTeam(int* pTeamNumOut = nullptr)
|
||||
inline bool IsInValidTeam(int* pTeamNumOut = nullptr)
|
||||
{
|
||||
int nTeamNum = m_iTeamNum();
|
||||
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
CBaseEntity* GetMoveParent()
|
||||
inline CBaseEntity* GetMoveParent()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseEntity", "moveparent") - 8;
|
||||
auto m_pMoveParent = reinterpret_cast<EHANDLE*>(uintptr_t(this) + nOffset);
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
return m_pMoveParent->Get();
|
||||
}
|
||||
|
||||
CBaseEntity* NextMovePeer()
|
||||
inline CBaseEntity* NextMovePeer()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseEntity", "moveparent") - 16;
|
||||
auto m_pMovePeer = reinterpret_cast<EHANDLE*>(uintptr_t(this) + nOffset);
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
return m_pMovePeer->Get();
|
||||
}
|
||||
|
||||
CBaseEntity* FirstMoveChild()
|
||||
inline CBaseEntity* FirstMoveChild()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseEntity", "moveparent") - 24;
|
||||
auto m_pMoveChild = reinterpret_cast<EHANDLE*>(uintptr_t(this) + nOffset);
|
||||
@@ -158,39 +158,39 @@ public:
|
||||
return m_pMoveChild->Get();
|
||||
}
|
||||
|
||||
void SetAbsOrigin(const Vec3& absOrigin)
|
||||
inline void SetAbsOrigin(const Vec3& absOrigin)
|
||||
{
|
||||
S::CBaseEntity_SetAbsOrigin.As<void(__fastcall*)(void*, const Vec3&)>()(this, absOrigin);
|
||||
}
|
||||
|
||||
void SetAbsAngles(const Vec3& absAngles)
|
||||
inline void SetAbsAngles(const Vec3& absAngles)
|
||||
{
|
||||
S::CBaseEntity_SetAbsAngles.As<void(__fastcall*)(void*, const Vec3&)>()(this, absAngles);
|
||||
}
|
||||
|
||||
void SetAbsVelocity(const Vec3& vecAbsVelocity)
|
||||
inline void SetAbsVelocity(const Vec3& vecAbsVelocity)
|
||||
{
|
||||
S::CBaseEntity_SetAbsVelocity.As<void(__fastcall*)(void*, const Vec3&)>()(this, vecAbsVelocity);
|
||||
}
|
||||
|
||||
void EstimateAbsVelocity(Vec3& vel)
|
||||
inline void EstimateAbsVelocity(Vec3& vel)
|
||||
{
|
||||
S::CBaseEntity_EstimateAbsVelocity.As<void(__fastcall*)(void*, Vec3&)>()(this, vel);
|
||||
}
|
||||
|
||||
Vec3 GetAbsVelocity()
|
||||
inline Vec3 GetAbsVelocity()
|
||||
{
|
||||
Vec3 vOut;
|
||||
EstimateAbsVelocity(vOut);
|
||||
return vOut;
|
||||
}
|
||||
|
||||
void CreateShadow()
|
||||
inline void CreateShadow()
|
||||
{
|
||||
S::CBaseEntity_CreateShadow.As<void(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
void InvalidateBoneCache()
|
||||
inline void InvalidateBoneCache()
|
||||
{
|
||||
S::CBaseEntity_InvalidateBoneCache.As<void(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
@@ -33,25 +33,25 @@ public:
|
||||
|
||||
VIRTUAL(GetNumBuildPoints, int, int(__fastcall*)(void*), IHasBuildPoints(), 0);
|
||||
|
||||
void* IHasBuildPoints()
|
||||
inline void* IHasBuildPoints()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseObject", "m_iUpgradeLevel") - 340;
|
||||
return reinterpret_cast<void*>(uintptr_t(this) + nOffset);
|
||||
};
|
||||
|
||||
bool GetBuildPoint(int iPoint, Vec3& vecOrigin, Vec3& vecAngles)
|
||||
inline bool GetBuildPoint(int iPoint, Vec3& vecOrigin, Vec3& vecAngles)
|
||||
{
|
||||
void* pPoints = IHasBuildPoints();
|
||||
return reinterpret_cast<bool(__fastcall*)(void*, int, Vec3&, Vec3&)>(U::Memory.GetVFunc(pPoints, 1))(pPoints, iPoint, vecOrigin, vecAngles);
|
||||
}
|
||||
|
||||
__inline int GetBuildPointAttachmentIndex(int iPoint)
|
||||
inline int GetBuildPointAttachmentIndex(int iPoint)
|
||||
{
|
||||
void* pPoints = IHasBuildPoints();
|
||||
return reinterpret_cast<int(__fastcall*)(void*, int)>(U::Memory.GetVFunc(pPoints, 2))(pPoints, iPoint);
|
||||
}
|
||||
|
||||
bool IsDisabled()
|
||||
inline bool IsDisabled()
|
||||
{
|
||||
return m_bDisabled() || m_bHasSapper();
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
NETVAR(m_iKills, int, "CObjectSentrygun", "m_iKills");
|
||||
NETVAR(m_iAssists, int, "CObjectSentrygun", "m_iAssists");
|
||||
|
||||
__inline int MaxAmmoShells()
|
||||
inline int MaxAmmoShells()
|
||||
{
|
||||
if (m_iUpgradeLevel() == 1 || m_bMiniBuilding())
|
||||
return 150;
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
return 200;
|
||||
}
|
||||
|
||||
__inline void GetAmmoCount(int& iShells, int& iMaxShells, int& iRockets, int& iMaxRockets)
|
||||
inline void GetAmmoCount(int& iShells, int& iMaxShells, int& iRockets, int& iMaxRockets)
|
||||
{
|
||||
const bool bIsMini = m_bMiniBuilding();
|
||||
|
||||
|
||||
@@ -86,43 +86,43 @@ public:
|
||||
VIRTUAL(PostThink, void, void(__fastcall*)(void*), this, 262);
|
||||
VIRTUAL(GetRenderedWeaponModel, CBaseAnimating*, CBaseAnimating*(__fastcall*)(void*), this, 251);
|
||||
|
||||
void SelectItem(const char* ptr, int subtype)
|
||||
inline void SelectItem(const char* ptr, int subtype)
|
||||
{
|
||||
reinterpret_cast<void(__fastcall*)(void*, const char*, int)>(U::Memory.GetVFunc(this, 271))(this, ptr, subtype);
|
||||
}
|
||||
|
||||
bool IsAlive()
|
||||
inline bool IsAlive()
|
||||
{
|
||||
return m_lifeState() == LIFE_ALIVE;
|
||||
}
|
||||
|
||||
Vec3 GetShootPos()
|
||||
inline Vec3 GetShootPos()
|
||||
{
|
||||
return m_vecOrigin() + m_vecViewOffset();
|
||||
}
|
||||
|
||||
Vec3 GetEyePosition()
|
||||
inline Vec3 GetEyePosition()
|
||||
{
|
||||
return GetAbsOrigin() + m_vecViewOffset();
|
||||
}
|
||||
|
||||
bool OnSolid()
|
||||
inline bool OnSolid()
|
||||
{
|
||||
return m_hGroundEntity() || IsOnGround();
|
||||
}
|
||||
|
||||
bool IsSwimming()
|
||||
inline bool IsSwimming()
|
||||
{
|
||||
return m_nWaterLevel() > 1;
|
||||
}
|
||||
|
||||
__inline void SetCurrentCmd(CUserCmd* pCmd)
|
||||
inline void SetCurrentCmd(CUserCmd* pCmd)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBasePlayer", "m_hConstraintEntity") - 8;
|
||||
*reinterpret_cast<CUserCmd**>(uintptr_t(this) + nOffset) = pCmd;
|
||||
}
|
||||
|
||||
int GetAmmoCount(int iAmmoType)
|
||||
inline int GetAmmoCount(int iAmmoType)
|
||||
{
|
||||
return S::CBasePlayer_GetAmmoCount.As<int(__fastcall*)(void*, int)>()(this, iAmmoType);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
NETVAR_OFF(m_flCreationTime, float, "CTFGrenadePipebombProjectile", "m_iType", 4);
|
||||
NETVAR_OFF(m_bPulsed, bool, "CTFGrenadePipebombProjectile", "m_iType", 12);
|
||||
|
||||
bool HasStickyEffects()
|
||||
inline bool HasStickyEffects()
|
||||
{
|
||||
return m_iType() == TF_GL_MODE_REMOTE_DETONATE || m_iType() == TF_GL_MODE_REMOTE_DETONATE_PRACTICE;
|
||||
}
|
||||
|
||||
@@ -36,13 +36,13 @@ public:
|
||||
class CCollisionProperty : public ICollideable
|
||||
{
|
||||
public:
|
||||
void SetCollisionBounds(const Vec3& mins, const Vec3& maxs)
|
||||
inline void SetCollisionBounds(const Vec3& mins, const Vec3& maxs)
|
||||
{
|
||||
static auto func = S::CCollisionPropert_SetCollisionBounds.As<void(__fastcall*)(CCollisionProperty*, const Vec3&, const Vec3&)>();
|
||||
func(this, mins, maxs);
|
||||
}
|
||||
|
||||
void CalcNearestPoint(const Vec3& vecWorldPt, Vec3* pVecNearestWorldPt)
|
||||
inline void CalcNearestPoint(const Vec3& vecWorldPt, Vec3* pVecNearestWorldPt)
|
||||
{
|
||||
static auto func = S::CCollisionProperty_CalcNearestPoint.As<void(__fastcall*)(CCollisionProperty*, const Vec3&, Vec3*)>();
|
||||
func(this, vecWorldPt, pVecNearestWorldPt);
|
||||
|
||||
@@ -19,12 +19,12 @@ public:
|
||||
reinterpret_cast<void(__fastcall*)(void*, const Vec3&, float, int, int)>(dwAddress)(this, center, radius, flagMask, partitionMask);
|
||||
}
|
||||
|
||||
CBaseEntity* GetCurrentEntity()
|
||||
inline CBaseEntity* GetCurrentEntity()
|
||||
{
|
||||
return (m_nListIndex < m_nListCount) ? m_pList[m_nListIndex] : nullptr;
|
||||
}
|
||||
|
||||
void NextEntity()
|
||||
inline void NextEntity()
|
||||
{
|
||||
m_nListIndex++;
|
||||
}
|
||||
|
||||
@@ -234,12 +234,12 @@ public:
|
||||
CONDGET(IsSupernovaRune, m_nPlayerCondEx3(), TFCondEx3_SupernovaRune);
|
||||
CONDGET(IsBuffedByKing, m_nPlayerCondEx3(), TFCondEx3_KingBuff);
|
||||
|
||||
Vec3 GetEyeAngles()
|
||||
inline Vec3 GetEyeAngles()
|
||||
{
|
||||
return { m_angEyeAnglesX(), m_angEyeAnglesY(), 0.f };
|
||||
}
|
||||
|
||||
Vec3 GetViewOffset() // use on nonlocal players
|
||||
inline Vec3 GetViewOffset() // use on nonlocal players
|
||||
{
|
||||
auto getMainOffset = [this]() -> Vec3
|
||||
{
|
||||
@@ -270,12 +270,12 @@ public:
|
||||
return getMainOffset() * flSize;
|
||||
}
|
||||
|
||||
bool IsFriend()
|
||||
inline bool IsFriend()
|
||||
{
|
||||
return S::CTFPlayer_IsPlayerOnSteamFriendsList.As<bool(__fastcall*)(void*, void*)>()(this, this);
|
||||
}
|
||||
|
||||
bool InCond(const ETFCond cond)
|
||||
inline bool InCond(const ETFCond cond)
|
||||
{
|
||||
const int iCond = static_cast<int>(cond);
|
||||
switch (iCond / 32)
|
||||
@@ -320,7 +320,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsInvisible()
|
||||
inline bool IsInvisible()
|
||||
{
|
||||
if (this->InCond(TF_COND_BURNING)
|
||||
|| this->InCond(TF_COND_BURNING_PYRO)
|
||||
@@ -331,7 +331,7 @@ public:
|
||||
return m_flInvisibility() >= 1.f;
|
||||
}
|
||||
|
||||
float GetInvisPercentage()
|
||||
inline float GetInvisPercentage()
|
||||
{
|
||||
static auto tf_spy_invis_time = I::CVar->FindVar("tf_spy_invis_time");
|
||||
const float flInvisTime = tf_spy_invis_time ? tf_spy_invis_time->GetFloat() : 1.f;
|
||||
@@ -340,12 +340,12 @@ public:
|
||||
return GetInvisPercent;
|
||||
}
|
||||
|
||||
bool IsZoomed()
|
||||
inline bool IsZoomed()
|
||||
{
|
||||
return InCond(TF_COND_ZOOMED);
|
||||
}
|
||||
|
||||
bool IsInvulnerable()
|
||||
inline bool IsInvulnerable()
|
||||
{
|
||||
return InCond(TF_COND_INVULNERABLE)
|
||||
|| InCond(TF_COND_INVULNERABLE_CARD_EFFECT)
|
||||
@@ -354,7 +354,7 @@ public:
|
||||
|| InCond(TF_COND_PHASE);
|
||||
}
|
||||
|
||||
bool IsUbered()
|
||||
inline bool IsUbered()
|
||||
{
|
||||
return InCond(TF_COND_INVULNERABLE)
|
||||
|| InCond(TF_COND_INVULNERABLE_CARD_EFFECT)
|
||||
@@ -362,7 +362,7 @@ public:
|
||||
|| InCond(TF_COND_INVULNERABLE_USER_BUFF);
|
||||
}
|
||||
|
||||
bool IsCritBoosted()
|
||||
inline bool IsCritBoosted()
|
||||
{
|
||||
return InCond(TF_COND_CRITBOOSTED)
|
||||
|| InCond(TF_COND_CRITBOOSTED_BONUS_TIME)
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
|| InCond(TF_COND_CRITBOOSTED_USER_BUFF);
|
||||
}
|
||||
|
||||
bool IsMiniCritBoosted()
|
||||
inline bool IsMiniCritBoosted()
|
||||
{
|
||||
return InCond(TF_COND_MINICRITBOOSTED_ON_KILL)
|
||||
|| InCond(TF_COND_NOHEALINGDAMAGEBUFF)
|
||||
@@ -384,14 +384,14 @@ public:
|
||||
/*|| InCond(TF_COND_CRITBOOSTED_DEMO_CHARGE)*/;
|
||||
}
|
||||
|
||||
bool IsMarked()
|
||||
inline bool IsMarked()
|
||||
{
|
||||
return InCond(TF_COND_URINE)
|
||||
|| InCond(TF_COND_MARKEDFORDEATH)
|
||||
|| InCond(TF_COND_MARKEDFORDEATH_SILENT);
|
||||
}
|
||||
|
||||
bool CanAttack()
|
||||
inline bool CanAttack()
|
||||
{
|
||||
if (!IsAlive() || IsTaunting() || IsBonked() || IsAGhost() || IsInBumperKart() || m_fFlags() & FL_FROZEN)
|
||||
return false;
|
||||
@@ -424,34 +424,34 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
CTFWeaponBase* GetWeaponFromSlot(int nSlot)
|
||||
inline CTFWeaponBase* GetWeaponFromSlot(int nSlot)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseCombatCharacter", "m_hMyWeapons");
|
||||
int hWeapon = *reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(this) + nOffset + nSlot * 4);
|
||||
return I::ClientEntityList->GetClientEntityFromHandle(hWeapon)->As<CTFWeaponBase>();
|
||||
}
|
||||
|
||||
float TeamFortress_CalculateMaxSpeed(bool bIgnoreSpecialAbility = false)
|
||||
inline float TeamFortress_CalculateMaxSpeed(bool bIgnoreSpecialAbility = false)
|
||||
{
|
||||
return S::TeamFortress_CalculateMaxSpeed.As<float(__fastcall*)(CTFPlayer*, bool)>()(this, bIgnoreSpecialAbility);
|
||||
}
|
||||
|
||||
void UpdateClientSideAnimation()
|
||||
inline void UpdateClientSideAnimation()
|
||||
{
|
||||
S::CTFPlayer_UpdateClientSideAnimation.As<void(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
float GetCritMult()
|
||||
inline float GetCritMult()
|
||||
{
|
||||
return Math::RemapValClamped(static_cast<float>(m_iCritMult()), 0.f, 255.f, 1.f, 4.f);
|
||||
}
|
||||
|
||||
void UpdateWearables()
|
||||
inline void UpdateWearables()
|
||||
{
|
||||
S::CTFPlayer_UpdateWearables.As<void(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
void ThirdPersonSwitch(/*bool bThirdperson*/)
|
||||
inline void ThirdPersonSwitch(/*bool bThirdperson*/)
|
||||
{
|
||||
return reinterpret_cast<void(__fastcall*)(void*/*, bool*/)>(U::Memory.GetVFunc(this, 255))(this/*, bThirdperson*/);
|
||||
};
|
||||
|
||||
@@ -49,115 +49,115 @@ public:
|
||||
NETVAR(m_iConnectionState, void*, "CTFPlayerResource", "m_iConnectionState");
|
||||
NETVAR(m_flConnectTime, void*, "CTFPlayerResource", "m_flConnectTime");
|
||||
|
||||
int GetPing(int idx)
|
||||
inline int GetPing(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iPing");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
int GetKills(int idx)
|
||||
inline int GetKills(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iScore");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
int GetDeaths(int idx)
|
||||
inline int GetDeaths(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iDeaths");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
bool GetConnected(int idx)
|
||||
inline bool GetConnected(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_bConnected");
|
||||
return *reinterpret_cast<bool*>(uintptr_t(this) + nOffset + idx);
|
||||
}
|
||||
|
||||
int GetTeam(int idx)
|
||||
inline int GetTeam(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iTeam");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
bool IsAlive(int idx)
|
||||
inline bool IsAlive(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_bAlive");
|
||||
return *reinterpret_cast<bool*>(uintptr_t(this) + nOffset + idx);
|
||||
}
|
||||
|
||||
int GetHealth(int idx)
|
||||
inline int GetHealth(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iHealth");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
unsigned GetAccountID(int idx)
|
||||
inline unsigned GetAccountID(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iAccountID");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
bool GetValid(int idx)
|
||||
inline bool GetValid(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_bValid");
|
||||
return *reinterpret_cast<bool*>(uintptr_t(this) + nOffset + idx);
|
||||
}
|
||||
|
||||
int GetUserID(int idx)
|
||||
inline int GetUserID(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iUserID");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
const char* GetPlayerName(int idx)
|
||||
inline const char* GetPlayerName(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iPing") - 816;
|
||||
return *reinterpret_cast<const char**>(uintptr_t(this) + nOffset + idx * 8);
|
||||
}
|
||||
|
||||
int GetScore(int idx)
|
||||
inline int GetScore(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iTotalScore");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
int GetLevel(int idx)
|
||||
inline int GetLevel(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iPlayerLevel");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
int GetDamage(int idx)
|
||||
inline int GetDamage(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iDamage");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
int GetClass(int idx)
|
||||
inline int GetClass(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iPlayerClass");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
int GetMaxHealth(int idx)
|
||||
inline int GetMaxHealth(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iMaxHealth");
|
||||
return *reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
int* GetStreaks(int idx)
|
||||
inline int* GetStreaks(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_iStreaks");
|
||||
return reinterpret_cast<int*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
float GetConnectionTime(int idx)
|
||||
inline float GetConnectionTime(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_flConnectTime");
|
||||
return *reinterpret_cast<float*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
}
|
||||
|
||||
float GetNextRespawnTime(int idx)
|
||||
inline float GetNextRespawnTime(int idx)
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFPlayerResource", "m_flNextRespawnTime");
|
||||
return *reinterpret_cast<float*>(uintptr_t(this) + nOffset + idx * 4);
|
||||
|
||||
@@ -204,17 +204,17 @@ public:
|
||||
|
||||
OFFSET(m_iWeaponMode, int, 996);
|
||||
|
||||
float GetSwingRange(CBaseEntity* pLocal)
|
||||
inline float GetSwingRange(CBaseEntity* pLocal)
|
||||
{
|
||||
return reinterpret_cast<int(__fastcall*)(CBaseEntity*)>(U::Memory.GetVFunc(this, 455))(pLocal);
|
||||
}
|
||||
|
||||
float GetSwingRange()
|
||||
inline float GetSwingRange()
|
||||
{
|
||||
return GetWeaponID() == TF_WEAPON_SWORD ? 72.f : 48.f;
|
||||
}
|
||||
|
||||
bool CanFireCriticalShot(bool bIsHeadshot = false)
|
||||
inline bool CanFireCriticalShot(bool bIsHeadshot = false)
|
||||
{
|
||||
auto pOwner = m_hOwnerEntity().Get()->As<CBasePlayer>();
|
||||
if (!pOwner)
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
bool CanPrimaryAttack()
|
||||
inline bool CanPrimaryAttack()
|
||||
{
|
||||
auto pOwner = m_hOwnerEntity().Get()->As<CBasePlayer>();
|
||||
if (!pOwner)
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
return m_flNextPrimaryAttack() <= flCurTime && pOwner->m_flNextAttack() <= flCurTime;
|
||||
}
|
||||
|
||||
bool CanSecondaryAttack()
|
||||
inline bool CanSecondaryAttack()
|
||||
{
|
||||
auto pOwner = m_hOwnerEntity().Get()->As<CBasePlayer>();
|
||||
if (!pOwner)
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
return m_flNextSecondaryAttack() <= flCurTime && pOwner->m_flNextAttack() <= flCurTime;
|
||||
}
|
||||
|
||||
bool HasPrimaryAmmoForShot()
|
||||
inline bool HasPrimaryAmmoForShot()
|
||||
{
|
||||
if (IsEnergyWeapon())
|
||||
return m_flEnergy() > 0.f;
|
||||
@@ -266,73 +266,73 @@ public:
|
||||
return nClip1 > 0;
|
||||
}
|
||||
|
||||
bool IsInReload()
|
||||
inline bool IsInReload()
|
||||
{
|
||||
return m_bInReload() || m_iReloadMode() != 0;
|
||||
}
|
||||
|
||||
bool IsRapidFire()
|
||||
inline bool IsRapidFire()
|
||||
{
|
||||
auto pWeaponInfo = GetWeaponInfo();
|
||||
return pWeaponInfo && pWeaponInfo->GetWeaponData(0).m_bUseRapidFireCrits;
|
||||
}
|
||||
|
||||
bool CanHeadShot()
|
||||
inline bool CanHeadShot()
|
||||
{
|
||||
return GetDamageType() & DMG_USE_HITLOCATIONS && CanFireCriticalShot(true);
|
||||
}
|
||||
|
||||
bool AmbassadorCanHeadshot()
|
||||
inline bool AmbassadorCanHeadshot()
|
||||
{
|
||||
if ((m_iItemDefinitionIndex() == Spy_m_TheAmbassador || m_iItemDefinitionIndex() == Spy_m_FestiveAmbassador) && I::GlobalVars->curtime - m_flLastFireTime() <= 1.f)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void GetProjectileFireSetup(void* pPlayer, Vector vecOffset, Vector* vecSrc, QAngle* angForward, bool bHitTeammates = true, float flEndDist = 2000.f)
|
||||
inline void GetProjectileFireSetup(void* pPlayer, Vector vecOffset, Vector* vecSrc, QAngle* angForward, bool bHitTeammates = true, float flEndDist = 2000.f)
|
||||
{
|
||||
using fn = void(__fastcall*)(CTFWeaponBase*, void*, Vector, Vector*, QAngle*, bool, float);
|
||||
reinterpret_cast<fn>(U::Memory.GetVFunc(this, 399))(this, pPlayer, vecOffset, vecSrc, angForward, bHitTeammates, flEndDist);
|
||||
}
|
||||
|
||||
void GetSpreadAngles(Vec3& out)
|
||||
inline void GetSpreadAngles(Vec3& out)
|
||||
{
|
||||
S::CTFWeaponBase_GetSpreadAngles.As<void(__fastcall*)(void*, Vec3&)>()(this, out);
|
||||
}
|
||||
|
||||
Vec3 GetSpreadAngles()
|
||||
inline Vec3 GetSpreadAngles()
|
||||
{
|
||||
Vec3 vOut;
|
||||
GetSpreadAngles(vOut);
|
||||
return vOut;
|
||||
}
|
||||
|
||||
void UpdateAllViewmodelAddons()
|
||||
inline void UpdateAllViewmodelAddons()
|
||||
{
|
||||
return S::CTFWeaponBase_UpdateAllViewmodelAddons.As<void(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
float ApplyFireDelay(float flDelay)
|
||||
inline float ApplyFireDelay(float flDelay)
|
||||
{
|
||||
return reinterpret_cast<float(__fastcall*)(void*, float)>(U::Memory.GetVFunc(this, 407))(this, flDelay);
|
||||
}
|
||||
|
||||
bool CalcIsAttackCriticalHelperMelee()
|
||||
inline bool CalcIsAttackCriticalHelperMelee()
|
||||
{
|
||||
return S::CTFWeaponBaseMelee_CalcIsAttackCriticalHelper.As<bool(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
bool CalcIsAttackCriticalHelper()
|
||||
inline bool CalcIsAttackCriticalHelper()
|
||||
{
|
||||
return S::CTFWeaponBase_CalcIsAttackCriticalHelper.As<bool(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
CBaseAnimating* GetAppropriateWorldOrViewModel()
|
||||
inline CBaseAnimating* GetAppropriateWorldOrViewModel()
|
||||
{
|
||||
return S::CTFWeaponBase_GetAppropriateWorldOrViewModel.As<CBaseAnimating * (__fastcall*)(void*)>()(this);
|
||||
}
|
||||
|
||||
float GetWeaponSpread()
|
||||
inline float GetWeaponSpread()
|
||||
{
|
||||
return S::CTFWeaponBaseGun_GetWeaponSpread.As<float(__fastcall*)(void*)>()(this);
|
||||
}
|
||||
@@ -368,14 +368,14 @@ public:
|
||||
NETVAR(m_hLastHealingTarget, EHANDLE, "CWeaponMedigun", "m_hLastHealingTarget");
|
||||
NETVAR(m_flChargeLevel, float, "CWeaponMedigun", "m_flChargeLevel");
|
||||
|
||||
int GetMedigunType()
|
||||
inline int GetMedigunType()
|
||||
{
|
||||
int iMode = 0;
|
||||
iMode = static_cast<int>(SDK::AttribHookValue(static_cast<float>(iMode), "set_weapon_mode", this));
|
||||
return iMode;
|
||||
}
|
||||
|
||||
MedigunChargeTypes GetChargeType()
|
||||
inline MedigunChargeTypes GetChargeType()
|
||||
{
|
||||
int iTmp = MEDIGUN_CHARGE_INVULN;
|
||||
iTmp = static_cast<int>(SDK::AttribHookValue(static_cast<float>(iTmp), "set_charge_type", this));
|
||||
@@ -386,7 +386,7 @@ public:
|
||||
return MedigunChargeTypes(iTmp);
|
||||
}
|
||||
|
||||
medigun_resist_types_t GetResistType()
|
||||
inline medigun_resist_types_t GetResistType()
|
||||
{
|
||||
int nCurrentActiveResist = (GetChargeType() - MEDIGUN_CHARGE_BULLET_RESIST);
|
||||
nCurrentActiveResist = nCurrentActiveResist % MEDIGUN_NUM_RESISTS;
|
||||
|
||||
@@ -16,37 +16,37 @@ public:
|
||||
virtual CMouthInfo* GetMouth(void) = 0;
|
||||
virtual bool GetSoundSpatialization(SpatializationInfo_t& info) = 0;
|
||||
|
||||
bool IsPlayer()
|
||||
inline bool IsPlayer()
|
||||
{
|
||||
return GetClassID() == ETFClassID::CTFPlayer;
|
||||
}
|
||||
|
||||
bool IsSentrygun()
|
||||
inline bool IsSentrygun()
|
||||
{
|
||||
return GetClassID() == ETFClassID::CObjectSentrygun;
|
||||
}
|
||||
|
||||
bool IsDispenser()
|
||||
inline bool IsDispenser()
|
||||
{
|
||||
return GetClassID() == ETFClassID::CObjectDispenser;
|
||||
}
|
||||
|
||||
bool IsTeleporter()
|
||||
inline bool IsTeleporter()
|
||||
{
|
||||
return GetClassID() == ETFClassID::CObjectTeleporter;
|
||||
}
|
||||
|
||||
bool IsBaseCombatWeapon()
|
||||
inline bool IsBaseCombatWeapon()
|
||||
{
|
||||
return GetClassID() == ETFClassID::CBaseCombatWeapon;
|
||||
}
|
||||
|
||||
bool IsWearable()
|
||||
inline bool IsWearable()
|
||||
{
|
||||
return GetClassID() == ETFClassID::CTFWearable;
|
||||
}
|
||||
|
||||
bool IsBuilding()
|
||||
inline bool IsBuilding()
|
||||
{
|
||||
switch (GetClassID())
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool IsPickup()
|
||||
inline bool IsPickup()
|
||||
{
|
||||
switch (GetClassID())
|
||||
{
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool IsNPC()
|
||||
inline bool IsNPC()
|
||||
{
|
||||
switch (GetClassID())
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool IsBomb()
|
||||
inline bool IsBomb()
|
||||
{
|
||||
switch (GetClassID())
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
virtual void SetDestroyedOnRecreateEntities(void) = 0;
|
||||
virtual void OnDataUnchangedInPVS() = 0;
|
||||
|
||||
ETFClassID GetClassID()
|
||||
inline ETFClassID GetClassID()
|
||||
{
|
||||
if (auto pClientClass = GetClientClass())
|
||||
return static_cast<ETFClassID>(pClientClass->m_ClassID);
|
||||
|
||||
@@ -13,29 +13,29 @@ public:
|
||||
|
||||
ADD_FEATURE_CUSTOM(CNetVars, NetVars, U);
|
||||
|
||||
#define NETVAR(_name, type, table, name) type& _name() \
|
||||
#define NETVAR(_name, type, table, name) inline type& _name() \
|
||||
{ \
|
||||
static int nOffset = U::NetVars.GetNetVar(table, name); \
|
||||
return *reinterpret_cast<type*>(uintptr_t(this) + nOffset); \
|
||||
}
|
||||
|
||||
#define NETVAR_OFF(_name, type, table, name, offset) type& _name() \
|
||||
#define NETVAR_OFF(_name, type, table, name, offset) inline type& _name() \
|
||||
{ \
|
||||
static int nOffset = U::NetVars.GetNetVar(table, name) + offset; \
|
||||
return *reinterpret_cast<type*>(uintptr_t(this) + nOffset); \
|
||||
}
|
||||
|
||||
#define OFFSET(name, type, offset) type& name() \
|
||||
#define OFFSET(name, type, offset) inline type& name() \
|
||||
{ \
|
||||
return *reinterpret_cast<type*>(uintptr_t(this) + offset); \
|
||||
}
|
||||
|
||||
#define VIRTUAL(name, type, fn, base, index) type name() \
|
||||
#define VIRTUAL(name, type, fn, base, index) inline type name() \
|
||||
{ \
|
||||
return reinterpret_cast<fn>(U::Memory.GetVFunc(base, index))(base); \
|
||||
}
|
||||
|
||||
#define CONDGET(name, conditions, cond) bool name() \
|
||||
#define CONDGET(name, conditions, cond) inline bool name() \
|
||||
{ \
|
||||
return (conditions & cond); \
|
||||
}
|
||||
Reference in New Issue
Block a user