misc fixes and changes

This commit is contained in:
rei-2
2026-02-08 01:28:05 -05:00
parent 473ef1b32f
commit 60689a50a2
27 changed files with 309 additions and 236 deletions
+5 -1
View File
@@ -67,7 +67,7 @@ namespace MAKE_INTERFACE_SCOPE \
static int nOffset = U::NetVars.GetNetVar(table, name); \
return reinterpret_cast<type>(uintptr_t(this) + nOffset); \
}
#define NETVAR_EMBED_OFF(_name, type, table, name, offset) inline type _name() \
#define NETVAR_OFF_EMBED(_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); \
@@ -86,6 +86,10 @@ namespace MAKE_INTERFACE_SCOPE \
{ \
return *reinterpret_cast<type*>(uintptr_t(this) + offset); \
}
#define OFFSET_EMBED(name, type, offset) inline type name() \
{ \
return reinterpret_cast<type>(uintptr_t(this) + offset); \
}
#define CONDGET(name, conditions, cond) inline bool name() \
{ \
return conditions & cond; \
@@ -20,16 +20,18 @@ void CAimbotGlobal::SortTargetsPre(std::vector<Target_t>& vTargets, int iMethod)
switch (iMethod)
{
case Vars::Aimbot::General::TargetSelectionEnum::FOV:
return std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
{
return a.m_flFOVTo < b.m_flFOVTo;
});
break;
case Vars::Aimbot::General::TargetSelectionEnum::Distance:
case Vars::Aimbot::General::TargetSelectionEnum::Hybrid:
return std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
{
return a.m_flDistTo < b.m_flDistTo;
});
std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
{
return a.m_flDistTo < b.m_flDistTo;
});
break;
}
}
@@ -38,10 +40,11 @@ void CAimbotGlobal::SortTargetsPost(std::vector<Target_t>& vTargets, int iMethod
switch (iMethod)
{
case Vars::Aimbot::General::TargetSelectionEnum::Hybrid:
return std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
{
return a.m_flFOVTo < b.m_flFOVTo;
});
break;
}
std::sort(vTargets.begin(), vTargets.end(), [&](const Target_t& a, const Target_t& b) -> bool
@@ -733,11 +733,16 @@ void CAutoHeal::Event(IGameEvent* pEvent, uint32_t uHash)
#ifdef DEBUG_VACCINATOR
SDK::Output("Hurt", std::format("{}, {}", m_iDamagedType, m_flDamagedDPS).c_str(), { 255, 100, 100 });
#endif
break;
return;
}
case FNV1A::Hash32Const("player_spawn"):
{
if (I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid")) != I::EngineClient->GetLocalPlayer())
return;
m_flDamagedTime = 0.f;
}
}
}
#ifdef DEBUG_VACCINATOR
+2 -3
View File
@@ -101,10 +101,9 @@ void CBacktrack::SendLerp()
}
}
void CBacktrack::SetLerp(IGameEvent* pEvent)
void CBacktrack::SetLerp()
{
if (I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid")) == I::EngineClient->GetLocalPlayer())
m_flFakeInterp = m_flSentInterp;
m_flFakeInterp = m_flSentInterp;
}
void CBacktrack::UpdateDatagram()
+1 -1
View File
@@ -59,7 +59,7 @@ public:
float GetFakeLatency();
float GetFakeInterp();
float GetWindow();
void SetLerp(IGameEvent* pEvent);
void SetLerp();
int GetAnticipatedChoke(int iMethod = Vars::Aimbot::General::AimType.Value);
void ResolverUpdate(CBaseEntity* pEntity);
+10 -9
View File
@@ -17,6 +17,7 @@ static inline void SetMain(BaseVar*& pBase, int iBind)
#define Set(t, b) if (IsType(t)) SetMain<t>(pBase, b);
static std::unordered_map<BaseVar*, bool> s_mVars = {};
static bool s_bUI = false, s_bMenu = false;
static inline void LoopVars(int iBind, std::vector<BaseVar*>& vVars = G::Vars)
{
@@ -66,16 +67,14 @@ static inline void GetBinds(int iParent, CTFPlayer* pLocal, CTFWeaponBase* pWeap
case BindEnum::KeyEnum::Toggle: bKey = U::KeyHandler.Pressed(tBind.m_iKey, false, &tBind.m_tKeyStorage); break;
case BindEnum::KeyEnum::DoubleClick: bKey = U::KeyHandler.Double(tBind.m_iKey, false, &tBind.m_tKeyStorage); break;
}
const bool bShouldUse = !I::EngineVGui->IsGameUIVisible() && (!I::MatSystemSurface->IsCursorVisible() || I::EngineClient->IsPlayingDemo())
|| F::Menu.m_bIsOpen && !ImGui::GetIO().WantTextInput && !F::Menu.m_bInKeybind && (!F::Menu.m_bWindowHovered || tBind.m_iKey != VK_LBUTTON && tBind.m_iKey != VK_RBUTTON); // allow in menu
bKey = bShouldUse && bKey;
bKey = bKey && (!s_bUI || s_bMenu && (!F::Menu.m_bWindowHovered || tBind.m_iKey != VK_LBUTTON && tBind.m_iKey != VK_RBUTTON)); // allow in menu
switch (tBind.m_iInfo)
{
case BindEnum::KeyEnum::Hold:
if (tBind.m_bNot)
bKey = !bKey;
tBind.m_bActive = bKey;
if (tBind.m_bNot)
tBind.m_bActive = !tBind.m_bActive;
break;
case BindEnum::KeyEnum::Toggle:
case BindEnum::KeyEnum::DoubleClick:
@@ -105,10 +104,7 @@ static inline void GetBinds(int iParent, CTFPlayer* pLocal, CTFWeaponBase* pWeap
}
case BindEnum::WeaponType:
{
if (tBind.m_iInfo != BindEnum::WeaponTypeEnum::Throwable)
tBind.m_bActive = tBind.m_iInfo + 1 == int(SDK::GetWeaponType(pWeapon));
else
tBind.m_bActive = G::Throwing;
tBind.m_bActive = tBind.m_iInfo == BindEnum::WeaponTypeEnum::Throwable ? G::Throwing : tBind.m_iInfo + 1 == int(SDK::GetWeaponType(pWeapon));
if (tBind.m_bNot)
tBind.m_bActive = !tBind.m_bActive;
break;
@@ -187,8 +183,13 @@ static inline void GetBinds(int iParent, CTFPlayer* pLocal, CTFWeaponBase* pWeap
void CBinds::SetVars(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, bool bManage)
{
s_mVars.clear();
s_bUI = I::EngineVGui->IsGameUIVisible() || I::MatSystemSurface->IsCursorVisible() && !I::EngineClient->IsPlayingDemo();
s_bMenu = F::Menu.m_bIsOpen && !ImGui::GetIO().WantTextInput && !F::Menu.m_bInKeybind;
GetBinds(DEFAULT_BIND, pLocal, pWeapon, m_vBinds, bManage);
LoopVars(DEFAULT_BIND);
m_bDisplay = F::Menu.m_bIsOpen || Vars::Menu::BindWindow.Value && !s_bUI;
}
void CBinds::Run()
+1
View File
@@ -47,6 +47,7 @@ public:
void Move(int i1, int i2);
std::vector<Bind_t> m_vBinds = {};
bool m_bDisplay = false;
};
ADD_FEATURE(CBinds, Binds);
+71 -89
View File
@@ -5,108 +5,90 @@
#include <utility>
#include <boost/algorithm/string/replace.hpp>
#define AddCommand(sCommand, fCommand) \
{ \
FNV1A::Hash32Const(sCommand), \
[](const std::deque<const char*>& vArgs) \
fCommand \
},
static std::unordered_map<uint32_t, CommandCallback> s_mCommands = {
AddCommand("setcvar",
{
FNV1A::Hash32Const("setcvar"),
[](const std::deque<const char*>& vArgs)
if (vArgs.size() < 2)
{
if (vArgs.size() < 2)
{
SDK::Output("Usage:\n\tsetcvar <cvar> <value>");
return;
}
SDK::Output("Usage:\n\tsetcvar <cvar> <value>");
return;
}
const char* sCVar = vArgs[0];
auto pCVar = I::CVar->FindVar(sCVar);
if (!pCVar)
{
SDK::Output(std::format("Could not find {}", sCVar).c_str());
return;
}
const char* sCVar = vArgs[0];
auto pCVar = I::CVar->FindVar(sCVar);
if (!pCVar)
{
SDK::Output(std::format("Could not find {}", sCVar).c_str());
return;
}
std::string sValue = "";
for (int i = 1; i < vArgs.size(); i++)
sValue += std::format("{} ", vArgs[i]);
sValue.pop_back();
boost::replace_all(sValue, "\"", "");
std::string sValue = "";
for (int i = 1; i < vArgs.size(); i++)
sValue += std::format("{} ", vArgs[i]);
sValue.pop_back();
boost::replace_all(sValue, "\"", "");
pCVar->SetValue(sValue.c_str());
SDK::Output(std::format("Set {} to {}", sCVar, sValue).c_str());
}
},
pCVar->SetValue(sValue.c_str());
SDK::Output(std::format("Set {} to {}", sCVar, sValue).c_str());
})
AddCommand("getcvar",
{
FNV1A::Hash32Const("getcvar"),
[](const std::deque<const char*>& vArgs)
if (vArgs.size() != 1)
{
if (vArgs.size() != 1)
{
SDK::Output("Usage:\n\tgetcvar <cvar>");
return;
}
SDK::Output("Usage:\n\tgetcvar <cvar>");
return;
}
const char* sCVar = vArgs[0];
auto pCVar = I::CVar->FindVar(sCVar);
if (!pCVar)
{
SDK::Output(std::format("Could not find {}", sCVar).c_str());
return;
}
const char* sCVar = vArgs[0];
auto pCVar = I::CVar->FindVar(sCVar);
if (!pCVar)
{
SDK::Output(std::format("Could not find {}", sCVar).c_str());
return;
}
SDK::Output(std::format("Value of {} is {}", sCVar, pCVar->GetString()).c_str());
}
},
SDK::Output(std::format("Value of {} is {}", sCVar, pCVar->GetString()).c_str());
})
AddCommand("queue",
{
FNV1A::Hash32Const("queue"),
[](const std::deque<const char*>& vArgs)
if (!I::TFPartyClient->AnySelected())
I::TFPartyClient->LoadSavedCasualCriteria();
I::TFPartyClient->RequestQueueForMatch(k_eTFMatchGroup_Casual_Default);
})
AddCommand("clear_chat",
{
I::ClientModeShared->m_pChatElement->SetText("");
})
AddCommand("menu",
{
I::MatSystemSurface->SetCursorAlwaysVisible(F::Menu.m_bIsOpen = !F::Menu.m_bIsOpen);
})
AddCommand("unload",
{
if (F::Menu.m_bIsOpen)
I::MatSystemSurface->SetCursorAlwaysVisible(F::Menu.m_bIsOpen = false);
U::Core.m_bUnload = true;
})
AddCommand("crash",
{ // if you want to time out of a server and rejoin
switch (vArgs.empty() ? 0 : FNV1A::Hash32(vArgs.front()))
{
static bool bHasLoaded = false;
if (!bHasLoaded)
{
I::TFPartyClient->LoadSavedCasualCriteria();
bHasLoaded = true;
}
I::TFPartyClient->RequestQueueForMatch(k_eTFMatchGroup_Casual_Default);
case FNV1A::Hash32Const("true"):
case FNV1A::Hash32Const("t"):
case FNV1A::Hash32Const("1"):
break;
default:
Vars::Debug::CrashLogging.Value = false; // we are voluntarily crashing, don't give out log if we don't want one
}
},
{
FNV1A::Hash32Const("clear_chat"),
[](const std::deque<const char*>& vArgs)
{
I::ClientModeShared->m_pChatElement->SetText("");
}
},
{
FNV1A::Hash32Const("menu"),
[](const std::deque<const char*>& vArgs)
{
I::MatSystemSurface->SetCursorAlwaysVisible(F::Menu.m_bIsOpen = !F::Menu.m_bIsOpen);
}
},
{
FNV1A::Hash32Const("unload"),
[](const std::deque<const char*>& vArgs)
{
if (F::Menu.m_bIsOpen)
I::MatSystemSurface->SetCursorAlwaysVisible(F::Menu.m_bIsOpen = false);
U::Core.m_bUnload = true;
}
},
{
FNV1A::Hash32Const("crash"),
[](const std::deque<const char*>& vArgs)
{ // if you want to time out of a server and rejoin
switch (vArgs.empty() ? 0 : FNV1A::Hash32(vArgs.front()))
{
case FNV1A::Hash32Const("true"):
case FNV1A::Hash32Const("t"):
case FNV1A::Hash32Const("1"):
break;
default:
Vars::Debug::CrashLogging.Value = false; // we are voluntarily crashing, don't give out log if we don't want one
}
reinterpret_cast<void(*)()>(0)();
}
},
reinterpret_cast<void(*)()>(0)();
})
};
bool CCommands::Run(const char* sCmd, std::deque<const char*>& vArgs)
+22 -5
View File
@@ -418,7 +418,7 @@ void CCritHack::Event(IGameEvent* pEvent, uint32_t uHash, CTFPlayer* pLocal)
case FNV1A::Hash32Const("player_hurt"):
{
if (!pLocal)
break;
return;
int iVictim = I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid"));
int iAttacker = I::EngineClient->GetPlayerForUserID(pEvent->GetInt("attacker"));
@@ -456,7 +456,7 @@ void CCritHack::Event(IGameEvent* pEvent, uint32_t uHash, CTFPlayer* pLocal)
StoreHealthHistory(iVictim, iHealth);
if (iVictim == iAttacker || iAttacker != I::EngineClient->GetLocalPlayer())
break;
return;
if (auto pGameRules = I::TFGameRules())
{
@@ -498,17 +498,34 @@ void CCritHack::Event(IGameEvent* pEvent, uint32_t uHash, CTFPlayer* pLocal)
else
m_iMeleeDamage += iDamage;
break;
return;
}
case FNV1A::Hash32Const("player_spawn"):
{
int iIndex = I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid"));
if (m_mHealthHistory.contains(iIndex))
{
auto& tHistory = m_mHealthHistory[iIndex];
tHistory.m_iSpawnCounter = -1;
}
return;
}
case FNV1A::Hash32Const("scorestats_accumulated_update"):
case FNV1A::Hash32Const("mvm_reset_stats"):
{
m_iRangedDamage = m_iCritDamage = m_iMeleeDamage = 0;
break;
return;
}
case FNV1A::Hash32Const("client_beginconnect"):
case FNV1A::Hash32Const("client_disconnect"):
case FNV1A::Hash32Const("game_newmap"):
{
Reset();
}
}
}
void CCritHack::Store()
@@ -533,7 +550,7 @@ void CCritHack::StoreHealthHistory(int iIndex, int iHealth, CTFPlayer* pPlayer)
else if (tHistory.m_iSpawnCounter == -1)
tHistory.m_iSpawnCounter = pPlayer->m_iSpawnCounter();
else if (tHistory.m_iSpawnCounter != pPlayer->m_iSpawnCounter())
return; // wait for event
return; // wait for spawn
}
if (!bContains)
@@ -143,12 +143,6 @@ namespace ImGui
return flMax;
}
inline float fnmodf(float flX, float flY)
{
// silly fix for negative values
return fmodf(flX, flY) + (flX < 0 ? flY : 0);
}
inline bool IsColorBright(ImColor tColor, float flValue = 0.686f, float flRed = 0.299f, float flGreen = 0.587f, float flBlue = 0.114f)
{
return tColor.Value.x * flRed + tColor.Value.y * flGreen + tColor.Value.z * flBlue > flValue;
+2 -2
View File
@@ -2706,7 +2706,7 @@ void CMenu::MenuSettings(int iTab)
case BindEnum::MiscEnum::Spectated: { sInfo = "any"; break; }
case BindEnum::MiscEnum::SpectatedFirst: { sInfo = "1st"; break; }
case BindEnum::MiscEnum::SpectatedThird: { sInfo = "3rd"; break; }
}
}
break;
case BindEnum::MiscEnum::Zoomed:
case BindEnum::MiscEnum::Aiming:
@@ -3539,7 +3539,7 @@ void CMenu::DrawBinds()
{
using namespace ImGui;
if (m_bIsOpen ? false : !Vars::Menu::BindWindow.Value || I::EngineVGui->IsGameUIVisible() || I::MatSystemSurface->IsCursorVisible() && !I::EngineClient->IsPlayingDemo())
if (!F::Binds.m_bDisplay)
return;
std::vector<BindInfo_t> vInfo;
@@ -4,12 +4,8 @@ void CAutoQueue::Run()
{
if (Vars::Misc::Queueing::AutoCasualQueue.Value && !I::TFPartyClient->BInQueueForMatchGroup(k_eTFMatchGroup_Casual_Default))
{
static bool bHasLoaded = false;
if (!bHasLoaded)
{
if (!I::TFPartyClient->AnySelected())
I::TFPartyClient->LoadSavedCasualCriteria();
bHasLoaded = true;
}
I::TFPartyClient->RequestQueueForMatch(k_eTFMatchGroup_Casual_Default);
}
}
+5
View File
@@ -420,8 +420,13 @@ void CMisc::Event(IGameEvent* pEvent, uint32_t uHash)
switch (uHash)
{
case FNV1A::Hash32Const("player_spawn"):
{
if (I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid")) != I::EngineClient->GetLocalPlayer())
return;
m_bPeekPlaced = false;
}
}
}
int CMisc::AntiBackstab(CTFPlayer* pLocal, CUserCmd* pCmd, bool bSendPacket)
@@ -182,9 +182,10 @@ void CMaterials::LoadMaterials()
for (auto& [_, tMaterial] : m_mMaterials)
{
KeyValues* kv = new KeyValues(tMaterial.m_sName.c_str());
bool bLoad = kv->LoadFromBuffer(tMaterial.m_sName.c_str(), tMaterial.m_sVMT.c_str());
if (!kv->LoadFromBuffer(tMaterial.m_sName.c_str(), tMaterial.m_sVMT.c_str()))
continue;
ModifyKeyValues(kv);
tMaterial.m_pMaterial = Create(tMaterial.m_sName.c_str(), kv);
//StoreVars(tMaterial);
}
@@ -233,8 +234,8 @@ void CMaterials::UnloadMaterials()
{
m_bLoaded = false;
for (auto& [_, mat] : m_mMaterials)
Remove(mat.m_pMaterial);
for (auto& [_, tMaterial] : m_mMaterials)
Remove(tMaterial.m_pMaterial);
m_mMaterials.clear();
m_mMatList.clear();
+24 -32
View File
@@ -450,6 +450,18 @@ std::vector<DrawBox_t> CVisuals::GetHitboxes(matrix3x4* aBones, CBaseAnimating*
Vec3 vMins = pBox->bbmin * pEntity->m_flModelScale();
Vec3 vMaxs = pBox->bbmax * pEntity->m_flModelScale();
if (Vars::Debug::Info.Value)
{
float flBoneScale = Vars::Aimbot::Hitscan::BoneSizeMinimumScale.Value;
float flBoneSubtract = Vars::Aimbot::Hitscan::BoneSizeSubtract.Value;
if (F::AimbotGlobal.ShouldMultipoint(pEntity, nHitbox, Vars::Aimbot::Hitscan::MultipointHitboxes.Value))
flBoneScale = std::max(flBoneScale, Vars::Aimbot::Hitscan::MultipointScale.Value / 100.f);
vMins = (pBox->bbmin + flBoneSubtract / pEntity->m_flModelScale()) * flBoneScale * pEntity->m_flModelScale();
vMaxs = (pBox->bbmax - flBoneSubtract / pEntity->m_flModelScale()) * flBoneScale * pEntity->m_flModelScale();
}
Color_t tEdge = bTargeted ? Vars::Colors::TargetHitboxEdgeIgnoreZ.Value : Vars::Colors::BoneHitboxEdgeIgnoreZ.Value;
Color_t tFace = bTargeted ? Vars::Colors::TargetHitboxFaceIgnoreZ.Value : Vars::Colors::BoneHitboxFaceIgnoreZ.Value;
if (tEdge.a || tFace.a)
@@ -459,28 +471,6 @@ std::vector<DrawBox_t> CVisuals::GetHitboxes(matrix3x4* aBones, CBaseAnimating*
tFace = bTargeted ? Vars::Colors::TargetHitboxFace.Value : Vars::Colors::BoneHitboxFace.Value;
if (tEdge.a || tFace.a)
vBoxes.emplace_back(vOrigin, vMins, vMaxs, vAngle, I::GlobalVars->curtime + Vars::Visuals::Hitbox::DrawDuration.Value, tEdge, tFace, true);
if (Vars::Debug::Info.Value)
{
float flBoneScale = Vars::Aimbot::Hitscan::BoneSizeMinimumScale.Value;
float flBoneSubtract = Vars::Aimbot::Hitscan::BoneSizeSubtract.Value;
if (F::AimbotGlobal.ShouldMultipoint(pEntity, nHitbox, Vars::Aimbot::Hitscan::MultipointHitboxes.Value))
flBoneScale = std::max(flBoneScale, Vars::Aimbot::Hitscan::MultipointScale.Value / 100.f);
Vec3 vCheckMins = (pBox->bbmin + flBoneSubtract / pEntity->m_flModelScale()) * flBoneScale * pEntity->m_flModelScale();
Vec3 vCheckMaxs = (pBox->bbmax - flBoneSubtract / pEntity->m_flModelScale()) * flBoneScale * pEntity->m_flModelScale();
tEdge = bTargeted ? Vars::Colors::TargetHitboxEdgeIgnoreZ.Value : Vars::Colors::BoneHitboxEdgeIgnoreZ.Value;
tFace = bTargeted ? Vars::Colors::TargetHitboxFaceIgnoreZ.Value : Vars::Colors::BoneHitboxFaceIgnoreZ.Value;
if (tEdge.a || tFace.a)
vBoxes.emplace_back(vOrigin, vCheckMins, vCheckMaxs, vAngle, I::GlobalVars->curtime + Vars::Visuals::Hitbox::DrawDuration.Value, tEdge, tFace);
tEdge = bTargeted ? Vars::Colors::TargetHitboxEdge.Value : Vars::Colors::BoneHitboxEdge.Value;
tFace = bTargeted ? Vars::Colors::TargetHitboxFace.Value : Vars::Colors::BoneHitboxFace.Value;
if (tEdge.a || tFace.a)
vBoxes.emplace_back(vOrigin, vCheckMins, vCheckMaxs, vAngle, I::GlobalVars->curtime + Vars::Visuals::Hitbox::DrawDuration.Value, tEdge, tFace, true);
}
}
return vBoxes;
@@ -766,15 +756,15 @@ void CVisuals::Event(IGameEvent* pEvent, uint32_t uHash)
bool bBones = Vars::Visuals::Hitbox::BonesEnabled.Value & Vars::Visuals::Hitbox::BonesEnabledEnum::OnHit;
bool bBounds = Vars::Visuals::Hitbox::BoundsEnabled.Value & Vars::Visuals::Hitbox::BoundsEnabledEnum::OnHit;
if (!bBones && !bBounds)
break;
return;
if (I::EngineClient->GetPlayerForUserID(pEvent->GetInt("attacker")) != I::EngineClient->GetLocalPlayer())
break;
return;
int iVictim = I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid"));
auto pEntity = I::ClientEntityList->GetClientEntity(iVictim)->As<CBaseAnimating>();
if (!pEntity || iVictim == I::EngineClient->GetLocalPlayer())
break;
return;
switch (G::PrimaryWeaponType)
{
@@ -782,21 +772,21 @@ void CVisuals::Event(IGameEvent* pEvent, uint32_t uHash)
case EWeaponType::MELEE:
{
if (!bBones)
break;
return;
auto aBones = F::Backtrack.GetBones(pEntity);
if (!aBones)
break;
return;
auto vBoxes = GetHitboxes(aBones, pEntity);
G::BoxStorage.insert(G::BoxStorage.end(), vBoxes.begin(), vBoxes.end());
break;
return;
}
case EWeaponType::PROJECTILE:
{
if (!bBounds)
break;
return;
if (Vars::Colors::BoundHitboxEdgeIgnoreZ.Value.a || Vars::Colors::BoundHitboxFaceIgnoreZ.Value.a)
G::BoxStorage.emplace_back(pEntity->m_vecOrigin(), pEntity->m_vecMins(), pEntity->m_vecMaxs(), Vec3(), I::GlobalVars->curtime + Vars::Visuals::Hitbox::DrawDuration.Value, Vars::Colors::BoundHitboxEdgeIgnoreZ.Value, Vars::Colors::BoundHitboxFaceIgnoreZ.Value);
@@ -805,7 +795,7 @@ void CVisuals::Event(IGameEvent* pEvent, uint32_t uHash)
}
}
break;
return;
}
case FNV1A::Hash32Const("item_pickup"):
{
@@ -824,15 +814,16 @@ void CVisuals::Event(IGameEvent* pEvent, uint32_t uHash)
Group_t* pGroup = nullptr;
if (!F::Groups.GetGroup(iType, pGroup, pEntity) || !pGroup->m_bPickupTimer)
break;
return;
m_vPickups.emplace_back(iType, I::GlobalVars->curtime + 10.f, pEntity->m_vecOrigin());
break;
return;
}
case FNV1A::Hash32Const("client_disconnect"):
case FNV1A::Hash32Const("client_beginconnect"):
case FNV1A::Hash32Const("game_newmap"):
case FNV1A::Hash32Const("teamplay_round_start"):
{
m_vPickups.clear();
G::LineStorage.clear();
@@ -841,6 +832,7 @@ void CVisuals::Event(IGameEvent* pEvent, uint32_t uHash)
G::SphereStorage.clear();
G::SweptStorage.clear();
}
}
}
void CVisuals::Store()
@@ -44,12 +44,12 @@ MAKE_HOOK(VGuiMenuBuilder_AddMenuItem, S::VGuiMenuBuilder_AddMenuItem(), void*,
const auto dwDesired1 = S::CTFClientScoreBoardDialog_OnScoreBoardMouseRightRelease_AddMenuItem_CallProfile();
const auto dwDesired2 = S::CTFClientScoreBoardDialog_OnScoreBoardMouseRightRelease_AddMenuItem_CallSpectate();
if (dwRetAddr == dwDesired1 && Vars::Visuals::UI::ScoreboardUtility.Value && s_iPlayerIndex != -1)
if (dwRetAddr == dwDesired1 && Vars::Visuals::UI::ScoreboardUtility.Value)
{
auto pReturn = CALL_ORIGINAL(rcx, pszButtonText, pszCommand, pszCategoryName);
if (auto pResource = H::Entities.GetResource())
if (auto pResource = H::Entities.GetResource(); pResource && pResource->m_bValid(s_iPlayerIndex))
{
auto pReturn = CALL_ORIGINAL(rcx, pszButtonText, pszCommand, pszCategoryName);
s_uAccountID = pResource->m_iAccountID(s_iPlayerIndex);
s_sPlayerName = pResource->GetName(s_iPlayerIndex);
@@ -67,12 +67,12 @@ MAKE_HOOK(VGuiMenuBuilder_AddMenuItem, S::VGuiMenuBuilder_AddMenuItem(), void*,
bool bHasTag = F::PlayerUtils.HasTag(s_uAccountID, iID);
CALL_ORIGINAL(rcx, std::format("{} {}", bHasTag ? "Remove" : "Add", tTag.m_sName).c_str(), std::format("modifytag{}", iID).c_str(), "tags");
}
return pReturn;
}
return pReturn;
}
if (dwRetAddr == dwDesired2 && Vars::Visuals::UI::ScoreboardUtility.Value && s_iPlayerIndex != -1)
if (dwRetAddr == dwDesired2 && Vars::Visuals::UI::ScoreboardUtility.Value)
return nullptr;
return CALL_ORIGINAL(rcx, pszButtonText, pszCommand, pszCategoryName);
@@ -5,6 +5,58 @@ MAKE_SIGNATURE(CTFPartyClient_SendPartyChat, "client.dll", "48 89 5C 24 ? 48 89
MAKE_SIGNATURE(CTFPartyClient_LoadSavedCasualCriteria, "client.dll", "48 83 79 ? ? C6 81 ? ? ? ? ? 74 ? 80 79 ? ? 74 ? C6 81 ? ? ? ? ? 48 8B 15", 0x0);
MAKE_SIGNATURE(CTFPartyClient_BInQueueForMatchGroup, "client.dll", "48 89 5C 24 ? 57 48 83 EC ? 48 8B F9 8B DA 8B CA E8 ? ? ? ? 84 C0", 0x0);
MAKE_SIGNATURE(CTFPartyClient_RequestQueueForMatch, "client.dll", "40 55 56 48 81 EC ? ? ? ? 48 63 F2", 0x0);
MAKE_SIGNATURE(CCasualCriteriaHelper_CCasualCriteriaHelper, "client.dll", "48 89 5C 24 ? 56 57 41 57 48 83 EC ? 0F 57 C0", 0x0);
MAKE_SIGNATURE(CTFGroupMatchCriteriaProto_DefaultInstance, "client.dll", "48 8B 05 ? ? ? ? 48 8B 50 ? 48 8D 4C 24 ? E8 ? ? ? ? 44 8B 44 24", 0x0);
class CTFCasualMatchCriteria
{
public:
};
class CCasualCriteriaHelper
{
public:
CCasualCriteriaHelper(const CTFCasualMatchCriteria* criteria)
{
S::CCasualCriteriaHelper_CCasualCriteriaHelper.Call<CCasualCriteriaHelper*>(this, criteria);
}
bool AnySelected() const { return !m_mapsBits.IsAllClear(); }
CLargeVarBitVec m_mapsBits;
};
class CTFGroupMatchCriteriaProto
{
public:
byte pad0[16];
uint32 has_bits[1];
mutable int cached_size;
bool late_join_ok;
uint32 custom_ping_tolerance;
std::string* mvm_mannup_tour;
byte mvm_mannup_missions[24];
byte mvm_bootcamp_missions[24];
CTFCasualMatchCriteria* casual_criteria;
static CTFGroupMatchCriteriaProto* GetDefaultInstance()
{
auto default_instance = *reinterpret_cast<CTFGroupMatchCriteriaProto**>(U::Memory.RelToAbs(S::CTFGroupMatchCriteriaProto_DefaultInstance()));
return default_instance;
}
CTFCasualMatchCriteria* GetCasualCriteria()
{
return casual_criteria ? casual_criteria : GetDefaultInstance()->casual_criteria;
}
};
class CTFGroupMatchCriteria
{
public:
VIRTUAL(Proto, CTFGroupMatchCriteriaProto*, 1, this);
};
class CTFPartyClient
{
@@ -13,6 +65,17 @@ public:
SIGNATURE(LoadSavedCasualCriteria, void, CTFPartyClient, this);
SIGNATURE_ARGS(BInQueueForMatchGroup, bool, CTFPartyClient, (int eMatchGroup), this, eMatchGroup);
SIGNATURE_ARGS(RequestQueueForMatch, void, CTFPartyClient, (int eMatchGroup), this, eMatchGroup);
OFFSET_EMBED(m_localGroupCriteria, CTFGroupMatchCriteria*, 432);
bool AnySelected()
{
auto pCriteria = m_localGroupCriteria();
auto pProto = pCriteria->Proto();
auto pCasualCriteria = pProto->GetCasualCriteria();
CCasualCriteriaHelper tHelper(pCasualCriteria);
return tHelper.AnySelected();
}
};
MAKE_INTERFACE_NULL(CTFPartyClient, TFPartyClient);
@@ -95,7 +95,7 @@ public:
NETVAR_OFF(m_MoveType, byte, "CTFPlayer", "m_nWaterLevel", -4);
NETVAR_OFF(m_MoveCollide, byte, "CTFPlayer", "m_nWaterLevel", -3);
NETVAR_OFF(m_nWaterType, byte, "CTFPlayer", "m_nWaterLevel", 1);
NETVAR_EMBED_OFF(m_Particles, CParticleProperty*, "CBaseEntity", "m_flElasticity", -56);
NETVAR_OFF_EMBED(m_Particles, CParticleProperty*, "CBaseEntity", "m_flElasticity", -56);
NETVAR_OFF(m_iv_vecVelocity, CInterpolatedVar<Vec3>, "CBaseEntity", "m_iTeamNum", 156);
NETVAR_OFF(m_iv_vecOrigin, CInterpolatedVar<Vec3>, "CBaseEntity", "m_flShadowCastDistance", 84);
NETVAR_OFF(m_iv_angRotation, CInterpolatedVar<Vec3>, "CBaseEntity", "m_vecOrigin", -128);
+15 -30
View File
@@ -37,16 +37,11 @@ bool CTFPlayer::InCond(ETFCond eCond)
{
switch (eCond / 32)
{
case 0:
return m_nPlayerCond() & (1 << eCond) || _condition_bits() & (1 << eCond);
case 1:
return m_nPlayerCondEx() & (1 << (eCond - 32));
case 2:
return m_nPlayerCondEx2() & (1 << (eCond - 64));
case 3:
return m_nPlayerCondEx3() & (1 << (eCond - 96));
case 4:
return m_nPlayerCondEx4() & (1 << (eCond - 128));
case 0: return m_nPlayerCond() & (1 << eCond) || _condition_bits() & (1 << eCond);
case 1: return m_nPlayerCondEx() & (1 << (eCond - 32));
case 2: return m_nPlayerCondEx2() & (1 << (eCond - 64));
case 3: return m_nPlayerCondEx3() & (1 << (eCond - 96));
case 4: return m_nPlayerCondEx4() & (1 << (eCond - 128));
}
return false;
}
@@ -55,16 +50,11 @@ void CTFPlayer::AddCond(ETFCond eCond)
{
switch (eCond / 32)
{
case 0:
m_nPlayerCond() |= (1 << eCond), _condition_bits() |= (1 << eCond); break;
case 1:
m_nPlayerCondEx() |= (1 << (eCond - 32)); break;
case 2:
m_nPlayerCondEx2() |= (1 << (eCond - 64)); break;
case 3:
m_nPlayerCondEx3() |= (1 << (eCond - 96)); break;
case 4:
m_nPlayerCondEx4() |= (1 << (eCond - 128)); break;
case 0: m_nPlayerCond() |= (1 << eCond), _condition_bits() |= (1 << eCond); break;
case 1: m_nPlayerCondEx() |= (1 << (eCond - 32)); break;
case 2: m_nPlayerCondEx2() |= (1 << (eCond - 64)); break;
case 3: m_nPlayerCondEx3() |= (1 << (eCond - 96)); break;
case 4: m_nPlayerCondEx4() |= (1 << (eCond - 128)); break;
}
}
@@ -72,16 +62,11 @@ void CTFPlayer::RemoveCond(ETFCond eCond)
{
switch (eCond / 32)
{
case 0:
m_nPlayerCond() &= ~(1 << eCond), _condition_bits() &= ~(1 << eCond); break;
case 1:
m_nPlayerCondEx() &= ~(1 << (eCond - 32)); break;
case 2:
m_nPlayerCondEx2() &= ~(1 << (eCond - 64)); break;
case 3:
m_nPlayerCondEx3() &= ~(1 << (eCond - 96)); break;
case 4:
m_nPlayerCondEx4() &= ~(1 << (eCond - 128)); break;
case 0: m_nPlayerCond() &= ~(1 << eCond), _condition_bits() &= ~(1 << eCond); break;
case 1: m_nPlayerCondEx() &= ~(1 << (eCond - 32)); break;
case 2: m_nPlayerCondEx2() &= ~(1 << (eCond - 64)); break;
case 3: m_nPlayerCondEx3() &= ~(1 << (eCond - 96)); break;
case 4: m_nPlayerCondEx4() &= ~(1 << (eCond - 128)); break;
}
}
@@ -462,6 +462,13 @@ void KeyValues::SetBool(const char* keyName, bool value)
SetInt(keyName, value ? 1 : 0);
}
void KeyValues::Clear()
{
delete m_pSub;
m_pSub = NULL;
m_iDataType = TYPE_NONE;
}
void KeyValues::DeleteThis()
{
delete this;
@@ -89,6 +89,7 @@ public:
void SetColor(const char* keyName, Color_t value);
void SetBool(const char* keyName, bool value);
void Clear();
void DeleteThis();
};
+12 -12
View File
@@ -843,7 +843,7 @@ struct Color_t
flR = flG = flB = flV;
else
{
int i = int(floor(flH /= 60));
int i = int(flH /= 60);
float flF = flH - i;
float flP = flV * (1 - flS);
float flQ = flV * (1 - flF * flS);
@@ -866,7 +866,7 @@ struct Color_t
a = byte(std::clamp(flA, 0.f, 255.f));
}
inline void GetHSV(float& flH, float& flS, float& flV)
inline void GetHSV(float& flH, float& flS, float& flV) const
{
float flR = r / 255.f;
float flG = g / 255.f;
@@ -901,14 +901,14 @@ struct Color_t
return tOut;
}
inline bool operator==(Color_t other) const
inline bool operator==(const Color_t t) const
{
return r == other.r && g == other.g && b == other.b && a == other.a;
return r == t.r && g == t.g && b == t.b && a == t.a;
}
inline bool operator!=(Color_t other) const
inline bool operator!=(const Color_t t) const
{
return r != other.r || g != other.g || b != other.b || a != other.a;
return r != t.r || g != t.g || b != t.b || a != t.a;
}
inline std::string ToHex() const
@@ -981,14 +981,14 @@ struct Gradient_t
Color_t StartColor = {};
Color_t EndColor = {};
inline bool operator==(Gradient_t other) const
inline bool operator==(const Gradient_t& t) const
{
return StartColor == other.StartColor && EndColor == other.EndColor;
return StartColor == t.StartColor && EndColor == t.EndColor;
}
inline bool operator!=(Gradient_t other) const
inline bool operator!=(const Gradient_t& t) const
{
return StartColor != other.StartColor || EndColor != other.EndColor;
return StartColor != t.StartColor || EndColor != t.EndColor;
}
};
@@ -1015,8 +1015,8 @@ struct Chams_t
struct Glow_t
{
int Stencil = 0;
float Blur = 0;
int Stencil = 0;
float Blur = 0;
inline bool operator==(const Glow_t& t) const
{
+11 -4
View File
@@ -55,16 +55,23 @@ void CEventListener::FireGameEvent(IGameEvent* pEvent)
switch (uHash)
{
case FNV1A::Hash32Const("player_hurt"):
{
F::Resolver.PlayerHurt(pEvent);
F::CheaterDetection.ReportDamage(pEvent);
break;
return;
}
case FNV1A::Hash32Const("player_spawn"):
F::Backtrack.SetLerp(pEvent);
break;
{
if (I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid")) != I::EngineClient->GetLocalPlayer())
return;
F::Backtrack.SetLerp();
return;
}
case FNV1A::Hash32Const("revive_player_notify"):
{
if (!Vars::Misc::MannVsMachine::InstantRevive.Value || pEvent->GetInt("entindex") != I::EngineClient->GetLocalPlayer())
break;
return;
KeyValues* kv = new KeyValues("MVM_Revive_Response");
kv->SetBool("accepted", true);
+6 -6
View File
@@ -276,7 +276,7 @@ bool SDK::IsOnScreen(CBaseEntity* pEntity, const matrix3x4& mTransform, float* p
return !(flRight < 0 || flLeft > H::Draw.m_nScreenW || flTop < 0 || flBottom > H::Draw.m_nScreenH);
}
bool SDK::IsOnScreen(CBaseEntity* pEntity, Vec3 vOrigin, bool bAll)
bool SDK::IsOnScreen(CBaseEntity* pEntity, const Vec3& vOrigin, bool bAll)
{
float flLeft = 0.f, flRight = 0.f, flTop = 0.f, flBottom = 0.f;
@@ -389,7 +389,7 @@ bool SDK::VisPosWorld(CBaseEntity* pSkip, const CBaseEntity* pEntity, const Vec3
return true;
}
Vec3 SDK::PredictOrigin(Vec3& vOrigin, Vec3 vVelocity, float flLatency, bool bTrace, Vec3 vMins, Vec3 vMaxs, unsigned int nMask, float flNormal)
Vec3 SDK::PredictOrigin(const Vec3& vOrigin, const Vec3& vVelocity, float flLatency, bool bTrace, const Vec3& vMins, const Vec3& vMaxs, unsigned int nMask, float flNormal)
{
if (vVelocity.IsZero() || !flLatency)
return vOrigin;
@@ -405,7 +405,7 @@ Vec3 SDK::PredictOrigin(Vec3& vOrigin, Vec3 vVelocity, float flLatency, bool bTr
return trace.endpos + (flNormal ? trace.plane.normal * flNormal : Vec3());
}
bool SDK::PredictOrigin(Vec3& vOut, Vec3& vOrigin, Vec3 vVelocity, float flLatency, bool bTrace, Vec3 vMins, Vec3 vMaxs, unsigned int nMask, float flNormal)
bool SDK::PredictOrigin(Vec3& vOut, const Vec3& vOrigin, const Vec3& vVelocity, float flLatency, bool bTrace, const Vec3& vMins, const Vec3& vMaxs, unsigned int nMask, float flNormal)
{
vOut = vOrigin;
if (vVelocity.IsZero() || !flLatency)
@@ -764,7 +764,7 @@ bool SDK::StopMovement(CTFPlayer* pLocal, CUserCmd* pCmd)
}
}
Vec3 SDK::ComputeMove(const CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vFrom, Vec3& vTo)
Vec3 SDK::ComputeMove(const CUserCmd* pCmd, CTFPlayer* pLocal, const Vec3& vFrom, const Vec3& vTo)
{
const Vec3 vDiff = vTo - vFrom;
if (!vDiff.Length2D())
@@ -782,7 +782,7 @@ Vec3 SDK::ComputeMove(const CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vFrom, Vec3
return vMove;
}
void SDK::WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vFrom, Vec3& vTo, float flScale)
void SDK::WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, const Vec3& vFrom, const Vec3& vTo, float flScale)
{
const auto vResult = ComputeMove(pCmd, pLocal, vFrom, vTo);
@@ -791,7 +791,7 @@ void SDK::WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vFrom, Vec3& vTo, floa
pCmd->upmove = vResult.z * flScale;
}
void SDK::WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vTo, float flScale)
void SDK::WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, const Vec3& vTo, float flScale)
{
Vec3 vLocalPos = pLocal->m_vecOrigin();
WalkTo(pCmd, pLocal, vLocalPos, vTo, flScale);
+16 -11
View File
@@ -61,11 +61,6 @@
#define VK_Y 0x59
#define VK_Z 0x5A
template <typename T> int sign(T val)
{
return (val > T(0)) - (val < T(0));
}
#define OUTPUT_CONSOLE 1 << 0
#define OUTPUT_DEBUG 1 << 1
#define OUTPUT_TOAST 1 << 2
@@ -73,6 +68,16 @@ template <typename T> int sign(T val)
#define OUTPUT_CHAT 1 << 4
#define OUTPUT_PARTY 1 << 5
template <class T> int sign(T val)
{
return (val > T(0)) - (val < T(0));
}
inline float fnmodf(float flX, float flY)
{ // silly fix for negative values
return fmodf(flX, flY) + (flX < 0 ? flY : 0);
}
namespace SDK
{
void Output(const char* sFunction, const char* sLog = nullptr, Color_t tColor = { 255, 255, 255, 255 },
@@ -103,7 +108,7 @@ namespace SDK
bool W2S(const Vec3& vOrigin, Vec3& vScreen, bool bAlways = false);
bool IsOnScreen(CBaseEntity* pEntity, const matrix3x4& mTransform, float* pLeft = nullptr, float* pRight = nullptr, float* pTop = nullptr, float* pBottom = nullptr, bool bAll = false);
bool IsOnScreen(CBaseEntity* pEntity, Vec3 vOrigin, bool bAll = false);
bool IsOnScreen(CBaseEntity* pEntity, const Vec3& vOrigin, bool bAll = false);
bool IsOnScreen(CBaseEntity* pEntity, bool bShouldGetOwner = true);
void Trace(const Vec3& vStart, const Vec3& vEnd, unsigned int nMask, ITraceFilter* pFilter, CGameTrace* pTrace);
@@ -113,8 +118,8 @@ namespace SDK
bool VisPosCollideable(CBaseEntity* pSkip, const CBaseEntity* pEntity, const Vec3& vFrom, const Vec3& vTo, unsigned int nMask = MASK_SHOT | CONTENTS_GRATE);
bool VisPosWorld(CBaseEntity* pSkip, const CBaseEntity* pEntity, const Vec3& vFrom, const Vec3& vTo, unsigned int nMask = MASK_SHOT | CONTENTS_GRATE);
Vec3 PredictOrigin(Vec3& vOrigin, Vec3 vVelocity, float flLatency, bool bTrace = true, Vec3 vMins = {}, Vec3 vMaxs = {}, unsigned int nMask = MASK_SOLID, float flNormal = 0.f);
bool PredictOrigin(Vec3& vOut, Vec3& vOrigin, Vec3 vVelocity, float flLatency, bool bTrace = true, Vec3 vMins = {}, Vec3 vMaxs = {}, unsigned int nMask = MASK_SOLID, float flNormal = 0.f);
Vec3 PredictOrigin(const Vec3& vOrigin, const Vec3& vVelocity, float flLatency, bool bTrace = true, const Vec3& vMins = {}, const Vec3& vMaxs = {}, unsigned int nMask = MASK_SOLID, float flNormal = 0.f);
bool PredictOrigin(Vec3& vOut, const Vec3& vOrigin, const Vec3& vVelocity, float flLatency, bool bTrace = true, const Vec3& vMins = {}, const Vec3& vMaxs = {}, unsigned int nMask = MASK_SOLID, float flNormal = 0.f);
bool IsLoopback();
int GetRoundState();
@@ -130,9 +135,9 @@ namespace SDK
void FixMovement(CUserCmd* pCmd, const Vec3& vTargetAngle);
bool StopMovement(CTFPlayer* pLocal, CUserCmd* pCmd);
Vec3 ComputeMove(const CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vFrom, Vec3& vTo);
void WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vFrom, Vec3& vTo, float flScale = 1.f);
void WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vTo, float flScale = 1.f);
Vec3 ComputeMove(const CUserCmd* pCmd, CTFPlayer* pLocal, const Vec3& vFrom, const Vec3& vTo);
void WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, const Vec3& vFrom, const Vec3& vTo, float flScale = 1.f);
void WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, const Vec3& vTo, float flScale = 1.f);
void GetProjectileFireSetup(CTFPlayer* pPlayer, const Vec3& vAngIn, Vec3 vOffset, Vec3& vPosOut, Vec3& vAngOut, bool bPipes = false, bool bInterp = false, bool bAllowFlip = true);
+5
View File
@@ -59,6 +59,11 @@ ADD_FEATURE_CUSTOM(CMemory, Memory, U);
return *reinterpret_cast<type*>(uintptr_t(this) + offset); \
}
#define OFFSET_EMBED(name, type, offset) inline type name() \
{ \
return reinterpret_cast<type>(uintptr_t(this) + offset); \
}
#define CONDGET(name, conditions, cond) inline bool name() \
{ \
return conditions & cond; \
+1 -1
View File
@@ -32,7 +32,7 @@ ADD_FEATURE_CUSTOM(CNetVars, NetVars, U);
return reinterpret_cast<type>(uintptr_t(this) + nOffset); \
}
#define NETVAR_EMBED_OFF(_name, type, table, name, offset) inline type _name() \
#define NETVAR_OFF_EMBED(_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); \