mirror of
https://github.com/rei-2/Amalgam
synced 2026-10-10 12:53:10 +08:00
fixes
0 lerp toggle clearchat command
This commit is contained in:
@@ -259,9 +259,9 @@ bool CAimbotGlobal::ShouldIgnore(CBaseEntity* pEntity, CTFPlayer* pLocal, CTFWea
|
||||
return true;
|
||||
}
|
||||
|
||||
int CAimbotGlobal::GetPriority(int targetIdx)
|
||||
int CAimbotGlobal::GetPriority(int iIndex)
|
||||
{
|
||||
return F::PlayerUtils.GetPriority(targetIdx);
|
||||
return F::PlayerUtils.GetPriority(iIndex);
|
||||
}
|
||||
|
||||
bool CAimbotGlobal::ShouldAim()
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
bool IsHitboxValid(uint32_t uHash, int nHitbox, int iHitboxes = Vars::Aimbot::Hitscan::HitboxesEnum::Head | Vars::Aimbot::Hitscan::HitboxesEnum::Body | Vars::Aimbot::Hitscan::HitboxesEnum::Pelvis | Vars::Aimbot::Hitscan::HitboxesEnum::Arms | Vars::Aimbot::Hitscan::HitboxesEnum::Legs);
|
||||
|
||||
bool ShouldIgnore(CBaseEntity* pTarget, CTFPlayer* pLocal, CTFWeaponBase* pWeapon);
|
||||
int GetPriority(int targetIdx);
|
||||
int GetPriority(int iIndex);
|
||||
|
||||
bool ShouldAim();
|
||||
bool ShouldHoldAttack(CTFWeaponBase* pWeapon);
|
||||
|
||||
@@ -1883,6 +1883,14 @@ bool CAimbotProjectile::RunMain(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUser
|
||||
}
|
||||
}
|
||||
|
||||
switch (nWeaponID)
|
||||
{
|
||||
case TF_WEAPON_BAT_WOOD:
|
||||
case TF_WEAPON_BAT_GIFTWRAP:
|
||||
case TF_WEAPON_LUNCHBOX:
|
||||
if (iRealAimType && G::Throwing == 1)
|
||||
G::Attacking = 1;
|
||||
}
|
||||
Aim(pCmd, tTarget.m_vAngleTo);
|
||||
if (G::PSilentAngles)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,9 @@ static inline Vec3 PredictOrigin(Vec3& vOrigin, Vec3 vVelocity, float flLatency,
|
||||
CTraceFilterWorldAndPropsOnly filter = {};
|
||||
|
||||
SDK::TraceHull(vOrigin, vTo, vMins, vMaxs, nMask, &filter, &trace);
|
||||
//G::SweptStorage.emplace_back(std::pair<Vec3, Vec3>(trace.startpos, trace.endpos), vMins, vMaxs, Vec3(), I::GlobalVars->curtime + 60.f, Color_t(255, 255, 255, 10), true);
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
G::SweptStorage.emplace_back(std::pair<Vec3, Vec3>(trace.startpos, trace.endpos), vMins, vMaxs, Vec3(), I::GlobalVars->curtime + 60.f, Color_t(255, 255, 255, 10), true);
|
||||
#endif
|
||||
Vec3 vOrigin2 = vOrigin + (vTo - vOrigin) * trace.fraction;
|
||||
if (trace.DidHit() && flNormal)
|
||||
vOrigin2 += trace.plane.normal * flNormal;
|
||||
@@ -65,8 +67,10 @@ static inline bool TraceToEntity(CTFPlayer* pPlayer, CBaseEntity* pEntity, Vec3&
|
||||
for (auto& vPoint : vPoints)
|
||||
{
|
||||
SDK::Trace(vPlayerOrigin + vPoint, vEntityOrigin, nMask, &filter, &trace);
|
||||
//if (trace.fraction == 1.f)
|
||||
// G::LineStorage.emplace_back(std::pair<Vec3, Vec3>(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Color_t(0, 255, 0, 25), true);
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
if (trace.fraction == 1.f)
|
||||
G::LineStorage.emplace_back(std::pair<Vec3, Vec3>(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Color_t(0, 255, 0, 25), true);
|
||||
#endif
|
||||
if (trace.fraction == 1.f)
|
||||
return true;
|
||||
}
|
||||
@@ -74,8 +78,10 @@ static inline bool TraceToEntity(CTFPlayer* pPlayer, CBaseEntity* pEntity, Vec3&
|
||||
else
|
||||
{
|
||||
SDK::Trace(vPlayerOrigin, vEntityOrigin, nMask, &filter, &trace);
|
||||
//if (trace.fraction == 1.f)
|
||||
// G::LineStorage.emplace_back(std::pair<Vec3, Vec3>(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Color_t(0, 255, 0, 25), true);
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
if (trace.fraction == 1.f)
|
||||
G::LineStorage.emplace_back(std::pair<Vec3, Vec3>(trace.startpos, trace.endpos), I::GlobalVars->curtime + 60.f, Color_t(0, 255, 0, 25), true);
|
||||
#endif
|
||||
return trace.fraction == 1.f;
|
||||
}
|
||||
|
||||
@@ -207,7 +213,9 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet
|
||||
if (bCheater) // may use seed pred +/ crits
|
||||
flDistanceDanger = std::max(flDistanceDanger, bCrits ? 1.f : 0.34f);
|
||||
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
//SDK::Output("Hitscan", std::format("{}, {}, {}, {}, {}", flDamage, flSpread, flDamageInLatency, flDamageDanger, flDistanceDanger).c_str(), { 255, 200, 200 }, Vars::Debug::Logging.Value);
|
||||
#endif
|
||||
flBulletDanger += flDamageDanger * flDistanceDanger;
|
||||
break;
|
||||
}
|
||||
@@ -242,7 +250,9 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet
|
||||
float flDamageDanger = flDamageInLatency / iPlayerHealth;
|
||||
float flDistanceDanger = Math::RemapVal(flDistance, flRadius, flRadius, 1.f, 0.001f);
|
||||
|
||||
//SDK::Output("Projectile", std::format("{}, {}, {}, {}", flDamage, flDamageInLatency, flDamageDanger, flDistanceDanger).c_str(), { 255, 200, 200 }, Vars::Debug::Logging.Value);
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
SDK::Output("Projectile", std::format("{}, {}, {}, {}", flDamage, flDamageInLatency, flDamageDanger, flDistanceDanger).c_str(), { 255, 200, 200 }, Vars::Debug::Logging.Value);
|
||||
#endif
|
||||
switch (iType)
|
||||
{
|
||||
case MEDIGUN_BULLET_RESIST: flBulletDanger += flDamageDanger * flDistanceDanger; break;
|
||||
@@ -285,7 +295,9 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet
|
||||
float flDamageDanger = flDamageInLatency / iPlayerHealth;
|
||||
float flDistanceDanger = Math::RemapVal(flDistance, 1100.f, 3200.f, 1.f, 0.001f);
|
||||
|
||||
//SDK::Output("Sentry", std::format("{}, {}, {}, {}", flDamage, flDamageInLatency, flDamageDanger, flDistanceDanger).c_str(), { 255, 200, 200 }, Vars::Debug::Logging.Value);
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
SDK::Output("Sentry", std::format("{}, {}, {}, {}", flDamage, flDamageInLatency, flDamageDanger, flDistanceDanger).c_str(), { 255, 200, 200 }, Vars::Debug::Logging.Value);
|
||||
#endif
|
||||
flBulletDanger += flDamageDanger * flDistanceDanger;
|
||||
}
|
||||
|
||||
@@ -462,8 +474,10 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet
|
||||
float flDamageDanger = flDamage / iPlayerHealth;
|
||||
float flDistanceDanger = Math::RemapVal(pTarget->m_vecOrigin().DistTo(vProjectileOrigin), flRadius, flRadius, 1.f, 0.001f);
|
||||
|
||||
//G::SphereStorage.emplace_back(vProjectileOrigin, flRadius, 36, 36, I::GlobalVars->curtime + 60.f, Color_t(255, 255, 255, 1), Color_t(0, 0, 0, 0), true);
|
||||
//SDK::Output(std::format("Projectile {}", iType).c_str(), std::format("{}, {}, {}", flDamage, flDamageDanger, flDistanceDanger).c_str(), { 255, 200, 200 }, Vars::Debug::Logging.Value);
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
G::SphereStorage.emplace_back(vProjectileOrigin, flRadius, 36, 36, I::GlobalVars->curtime + 60.f, Color_t(255, 255, 255, 1), Color_t(0, 0, 0, 0), true);
|
||||
SDK::Output(std::format("Projectile {}", iType).c_str(), std::format("{}, {}, {}", flDamage, flDamageDanger, flDistanceDanger).c_str(), { 255, 200, 200 }, Vars::Debug::Logging.Value);
|
||||
#endif
|
||||
switch (iType)
|
||||
{
|
||||
case MEDIGUN_BULLET_RESIST:
|
||||
@@ -537,13 +551,18 @@ void CAutoHeal::AutoVaccinator(CTFPlayer* pLocal, CWeaponMedigun* pWeapon, CUser
|
||||
if (!Vars::Aimbot::Healing::AutoVaccinator.Value || pWeapon->GetMedigunType() != MEDIGUN_RESIST)
|
||||
return;
|
||||
|
||||
//G::LineStorage.clear();
|
||||
//G::SweptStorage.clear();
|
||||
//G::SphereStorage.clear();
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
G::LineStorage.clear();
|
||||
G::SweptStorage.clear();
|
||||
G::SphereStorage.clear();
|
||||
#endif
|
||||
if (m_iResistType == -1)
|
||||
m_iResistType = pWeapon->GetResistType();
|
||||
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
vResistDangers = {
|
||||
#else
|
||||
std::vector<std::pair<float, int>> vResistDangers = {
|
||||
#endif
|
||||
{ 0.f, MEDIGUN_BULLET_RESIST },
|
||||
{ 0.f, MEDIGUN_BLAST_RESIST },
|
||||
{ 0.f, MEDIGUN_FIRE_RESIST }
|
||||
@@ -676,7 +695,9 @@ void CAutoHeal::Event(IGameEvent* pEvent, uint32_t uHash)
|
||||
}
|
||||
m_flDamagedTime = 1.f;
|
||||
|
||||
//SDK::Output("Hurt", std::format("{}, {}", m_iDamagedType, m_flDamagedDPS).c_str(), { 255, 100, 100 });
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
SDK::Output("Hurt", std::format("{}, {}", m_iDamagedType, m_flDamagedDPS).c_str(), { 255, 100, 100 });
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case FNV1A::Hash32Const("player_spawn"):
|
||||
@@ -684,7 +705,7 @@ void CAutoHeal::Event(IGameEvent* pEvent, uint32_t uHash)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
void CAutoHeal::Draw(CTFPlayer* pLocal)
|
||||
{
|
||||
auto pWeapon = H::Entities.GetWeapon()->As<CWeaponMedigun>();
|
||||
@@ -700,4 +721,4 @@ void CAutoHeal::Draw(CTFPlayer* pLocal)
|
||||
for (auto& [flDanger, iResist] : vResistDangers)
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOP, std::format("{}: {:.3f}", iResist == MEDIGUN_BULLET_RESIST ? "Bullet" : iResist == MEDIGUN_BLAST_RESIST ? "Blast" : "Fire", flDanger).c_str());
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
#include "../../../SDK/SDK.h"
|
||||
|
||||
#define DEBUG_VACCINATOR
|
||||
|
||||
class CAutoHeal
|
||||
{
|
||||
void ActivateOnVoice(CTFPlayer* pLocal, CWeaponMedigun* pWeapon, CUserCmd* pCmd);
|
||||
@@ -19,12 +21,16 @@ class CAutoHeal
|
||||
float m_flDamagedDPS = -1;
|
||||
float m_flDamagedTime = 0.f;
|
||||
|
||||
//std::vector<std::pair<float, int>> vResistDangers = {};
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
std::vector<std::pair<float, int>> vResistDangers = {};
|
||||
#endif
|
||||
|
||||
public:
|
||||
void Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd);
|
||||
void Event(IGameEvent* pEvent, uint32_t uHash);
|
||||
//void Draw(CTFPlayer* pLocal);
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
void Draw(CTFPlayer* pLocal);
|
||||
#endif
|
||||
|
||||
std::unordered_map<int, bool> m_mMedicCallers = {};
|
||||
};
|
||||
|
||||
@@ -76,6 +76,11 @@ void CCommands::Initialize()
|
||||
SDK::Output(std::format("Value of {} is {}", sCVar, pCVar->GetString()).c_str());
|
||||
});
|
||||
|
||||
Register("clearchat", [](const std::deque<std::string>& vArgs)
|
||||
{
|
||||
I::ClientModeShared->m_pChatElement->SetText("");
|
||||
});
|
||||
|
||||
Register("menu", [](const std::deque<std::string>& vArgs)
|
||||
{
|
||||
I::MatSystemSurface->SetCursorAlwaysVisible(F::Menu.m_bIsOpen = !F::Menu.m_bIsOpen);
|
||||
|
||||
@@ -1205,18 +1205,19 @@ void CMenu::MenuVisuals(int iTab)
|
||||
{
|
||||
if (Section("Removals", 8))
|
||||
{
|
||||
FToggle(Vars::Visuals::Removals::Scope, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::Interpolation, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::Interpolation, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::NoLerp, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::Disguises, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::ScreenOverlays, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::Taunts, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::Taunts, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::Scope, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::PostProcessing, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::ScreenOverlays, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::ScreenEffects, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::ViewPunch, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::AngleForcing, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::PostProcessing, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::MOTD, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::Ragdolls, FToggleEnum::Left);
|
||||
FToggle(Vars::Visuals::Removals::Gibs, FToggleEnum::Right);
|
||||
FToggle(Vars::Visuals::Removals::MOTD, FToggleEnum::Left);
|
||||
} EndSection();
|
||||
if (Section("UI"))
|
||||
{
|
||||
|
||||
@@ -36,8 +36,9 @@ bool CFakeLag::IsAllowed(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pC
|
||||
return I::ClientState->chokedcommands < m_iGoal;
|
||||
case Vars::Fakelag::FakelagEnum::Adaptive:
|
||||
{
|
||||
const Vec3 vDelta = m_vLastPosition - pLocal->m_vecOrigin();
|
||||
return vDelta.Length2DSqr() < 4096.f;
|
||||
static auto sv_lagcompensation_teleport_dist = U::ConVars.FindVar("sv_lagcompensation_teleport_dist");
|
||||
const float flDist = powf(sv_lagcompensation_teleport_dist->GetFloat(), 2.f);
|
||||
return (m_vLastPosition - pLocal->m_vecOrigin()).Length2DSqr() < flDist;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -185,13 +185,11 @@ int CPlayerlistUtils::GetPriority(uint32_t uFriendsID, bool bCache)
|
||||
if (!tTag.m_bLabel)
|
||||
vPriorities.push_back(tTag.m_iPriority);
|
||||
}
|
||||
if (vPriorities.empty())
|
||||
return iDefault;
|
||||
|
||||
if (vPriorities.size())
|
||||
{
|
||||
std::sort(vPriorities.begin(), vPriorities.end(), std::greater<int>());
|
||||
return *vPriorities.begin();
|
||||
}
|
||||
return iDefault;
|
||||
std::sort(vPriorities.begin(), vPriorities.end(), std::greater<int>());
|
||||
return vPriorities.front();
|
||||
}
|
||||
int CPlayerlistUtils::GetPriority(int iIndex, bool bCache)
|
||||
{
|
||||
@@ -266,10 +264,10 @@ PriorityLabel_t* CPlayerlistUtils::GetSignificantTag(uint32_t uFriendsID, int iM
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
}
|
||||
if (!vTags.size())
|
||||
if (vTags.empty())
|
||||
return nullptr;
|
||||
|
||||
std::sort(vTags.begin(), vTags.end(), [&](const auto a, const auto b) -> bool
|
||||
std::sort(vTags.begin(), vTags.end(), [&](const PriorityLabel_t* a, const PriorityLabel_t* b) -> bool
|
||||
{
|
||||
// sort by priority if unequal
|
||||
if (a->m_iPriority != b->m_iPriority)
|
||||
|
||||
@@ -103,7 +103,7 @@ void CTickshiftHandler::SaveShootAngle(CUserCmd* pCmd, bool bSendPacket)
|
||||
|
||||
if (bSendPacket)
|
||||
m_bShootAngle = false;
|
||||
if (!m_bShootAngle && G::Attacking == 1 && sv_maxusrcmdprocessticks_holdaim->GetBool())
|
||||
else if (!m_bShootAngle && G::Attacking == 1 && sv_maxusrcmdprocessticks_holdaim->GetBool())
|
||||
m_vShootAngle = pCmd->viewangles, m_bShootAngle = true;
|
||||
}
|
||||
Vec3* CTickshiftHandler::GetShootAngle()
|
||||
|
||||
@@ -12,6 +12,9 @@ MAKE_HOOK(GetClientInterpAmount, S::GetClientInterpAmount(), float,
|
||||
return CALL_ORIGINAL();
|
||||
#endif
|
||||
|
||||
if (Vars::Visuals::Removals::NoLerp.Value)
|
||||
return CALL_ORIGINAL();
|
||||
|
||||
static const auto dwDesired1 = S::CNetGraphPanel_DrawTextFields_GetClientInterpAmount_Call1();
|
||||
static const auto dwDesired2 = S::CNetGraphPanel_DrawTextFields_GetClientInterpAmount_Call2();
|
||||
const auto dwRetAddr = uintptr_t(_ReturnAddress());
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../Features/Visuals/ESP/ESP.h"
|
||||
#include "../Features/Visuals/CameraWindow/CameraWindow.h"
|
||||
#include "../Features/Visuals/Notifications/Notifications.h"
|
||||
//#include "../Features/Aimbot/AutoHeal/AutoHeal.h"
|
||||
#include "../Features/Aimbot/AutoHeal/AutoHeal.h"
|
||||
|
||||
MAKE_HOOK(IEngineVGui_Paint, U::Memory.GetVirtual(I::EngineVGui, 14), void,
|
||||
void* rcx, int iMode)
|
||||
@@ -43,7 +43,9 @@ MAKE_HOOK(IEngineVGui_Paint, U::Memory.GetVirtual(I::EngineVGui, 14), void,
|
||||
F::Aimbot.Draw(pLocal);
|
||||
F::Radar.Run(pLocal);
|
||||
|
||||
//F::AutoHeal.Draw(pLocal);
|
||||
#ifdef DEBUG_VACCINATOR
|
||||
F::AutoHeal.Draw(pLocal);
|
||||
#endif
|
||||
F::NoSpreadHitscan.Draw(pLocal);
|
||||
F::PlayerConditions.Draw(pLocal);
|
||||
F::Backtrack.Draw(pLocal);
|
||||
|
||||
@@ -14,6 +14,12 @@ class CBaseHudChat
|
||||
public:
|
||||
VIRTUAL_ARGS(ChatPrintf, void, 19, (int pIndex, const char* fmt, ...), this, pIndex, 0, fmt);
|
||||
VIRTUAL_ARGS(StartMessageMode, void, 20, (int iMessageModeType), this, iMessageModeType);
|
||||
|
||||
inline void SetText(const char* text)
|
||||
{
|
||||
if (auto pChatHistory = *reinterpret_cast<void**>(uintptr_t(this) + 688))
|
||||
U::Memory.CallVirtual<239, void>(pChatHistory, text);
|
||||
}
|
||||
};
|
||||
|
||||
class CClientModeShared : public IClientMode, public CGameEventListener
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace G
|
||||
inline bool CanPrimaryAttack = false;
|
||||
inline bool CanSecondaryAttack = false;
|
||||
inline bool CanHeadshot = false;
|
||||
inline bool Throwing = false;
|
||||
inline int Throwing = false;
|
||||
inline float Lerp = 0.015f;
|
||||
|
||||
inline EWeaponType PrimaryWeaponType = {}, SecondaryWeaponType = {};
|
||||
|
||||
+30
-16
@@ -474,14 +474,21 @@ int SDK::IsAttacking(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, const CUserCmd*
|
||||
case TF_WEAPON_BAT_WOOD:
|
||||
case TF_WEAPON_BAT_GIFTWRAP:
|
||||
{
|
||||
static int iThrowTick = 0;
|
||||
if (iThrowTick + 5 < iTickBase)
|
||||
iThrowTick = 0;
|
||||
if (G::CanPrimaryAttack && pWeapon->HasPrimaryAmmoForShot() && pCmd->buttons & IN_ATTACK2 && !iThrowTick)
|
||||
iThrowTick = iTickBase + 11;
|
||||
if (iThrowTick >= iTickBase)
|
||||
G::CanSecondaryAttack = G::Throwing = true;
|
||||
if (iThrowTick && iThrowTick <= iTickBase)
|
||||
static int iThrowTick = -5;
|
||||
{
|
||||
static int iLastTickBase = iTickBase;
|
||||
if (iTickBase != iLastTickBase)
|
||||
iThrowTick = std::max(iThrowTick - 1, -5);
|
||||
iLastTickBase = iTickBase;
|
||||
}
|
||||
|
||||
if (G::CanPrimaryAttack && pWeapon->HasPrimaryAmmoForShot() && pCmd->buttons & IN_ATTACK2 && iThrowTick == -5)
|
||||
iThrowTick = 12;
|
||||
if (iThrowTick > -5)
|
||||
G::Throwing = G::CanSecondaryAttack = true;
|
||||
if (iThrowTick > 1)
|
||||
G::Throwing = 2;
|
||||
if (iThrowTick == 1)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -529,15 +536,22 @@ int SDK::IsAttacking(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, const CUserCmd*
|
||||
case TF_WEAPON_JAR_MILK:
|
||||
case TF_WEAPON_JAR_GAS:
|
||||
{
|
||||
static int iThrowTick = -5;
|
||||
{
|
||||
static int iLastTickBase = iTickBase;
|
||||
if (iTickBase != iLastTickBase)
|
||||
iThrowTick = std::max(iThrowTick - 1, -5);
|
||||
iLastTickBase = iTickBase;
|
||||
}
|
||||
|
||||
const int iAttack = pWeapon->GetWeaponID() == TF_WEAPON_CLEAVER ? IN_ATTACK | IN_ATTACK2 : IN_ATTACK;
|
||||
static int iThrowTick = 0;
|
||||
if (iThrowTick < iTickBase)
|
||||
iThrowTick = 0;
|
||||
if (G::CanPrimaryAttack && pWeapon->HasPrimaryAmmoForShot() && pCmd->buttons & iAttack && !iThrowTick)
|
||||
iThrowTick = iTickBase + 11;
|
||||
if (iThrowTick >= iTickBase)
|
||||
G::CanPrimaryAttack = G::Throwing = true;
|
||||
return iThrowTick && iThrowTick <= iTickBase;
|
||||
if (G::CanPrimaryAttack && pWeapon->HasPrimaryAmmoForShot() && pCmd->buttons & iAttack && iThrowTick == -5)
|
||||
iThrowTick = 12;
|
||||
if (iThrowTick > -5)
|
||||
G::Throwing = G::CanSecondaryAttack = true;
|
||||
if (iThrowTick > 1)
|
||||
G::Throwing = 2;
|
||||
return iThrowTick == 1;
|
||||
}
|
||||
case TF_WEAPON_GRAPPLINGHOOK:
|
||||
{
|
||||
|
||||
@@ -713,18 +713,19 @@ namespace Vars
|
||||
SUBNAMESPACE_END(ThirdPerson);
|
||||
|
||||
SUBNAMESPACE_BEGIN(Removals)
|
||||
CVar(Scope, VA_LIST("Scope", "Scope removal"), false, VISUAL);
|
||||
CVar(Interpolation, VA_LIST("Interpolation", "Interpolation removal"), false);
|
||||
CVar(NoLerp, VA_LIST("0 lerp", "0 lerp removal"), false);
|
||||
CVar(Disguises, VA_LIST("Disguises", "Disguises removal"), false, VISUAL);
|
||||
CVar(ScreenOverlays, VA_LIST("Screen overlays", "Screen overlays removal"), false, VISUAL);
|
||||
CVar(Taunts, VA_LIST("Taunts", "Taunts removal"), false, VISUAL);
|
||||
CVar(Scope, VA_LIST("Scope", "Scope removal"), false, VISUAL);
|
||||
CVar(PostProcessing, VA_LIST("Post processing", "Post processing removal"), false, VISUAL);
|
||||
CVar(ScreenOverlays, VA_LIST("Screen overlays", "Screen overlays removal"), false, VISUAL);
|
||||
CVar(ScreenEffects, VA_LIST("Screen effects", "Screen effects removal"), false, VISUAL);
|
||||
CVar(ViewPunch, VA_LIST("View punch", "View punch removal"), false, VISUAL);
|
||||
CVar(AngleForcing, VA_LIST("Angle forcing", "Angle forcing removal"), false, VISUAL);
|
||||
CVar(PostProcessing, VA_LIST("Post processing", "Post processing removal"), false, VISUAL);
|
||||
CVar(MOTD, VA_LIST("MOTD", "MOTD removal"), false, VISUAL);
|
||||
CVar(Ragdolls, VA_LIST("Ragdolls", "Ragdoll removal"), false, VISUAL);
|
||||
CVar(Gibs, VA_LIST("Gibs", "Gib removal"), false, VISUAL);
|
||||
CVar(MOTD, VA_LIST("MOTD", "MOTD removal"), false, VISUAL);
|
||||
SUBNAMESPACE_END(Removals);
|
||||
|
||||
SUBNAMESPACE_BEGIN(Effects)
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
struct Frame
|
||||
{
|
||||
std::string m_sModule = "";
|
||||
uintptr_t m_pBase = 0;
|
||||
uintptr_t m_pAddress = 0;
|
||||
uintptr_t m_uBase = 0;
|
||||
uintptr_t m_uAddress = 0;
|
||||
std::string m_sFile = "";
|
||||
unsigned int m_uLine = 0;
|
||||
std::string m_sName = "";
|
||||
@@ -43,17 +43,17 @@ static std::deque<Frame> StackTrace(PCONTEXT context)
|
||||
{
|
||||
Frame tFrame = {};
|
||||
|
||||
tFrame.m_pAddress = frame.AddrPC.Offset;
|
||||
tFrame.m_uAddress = frame.AddrPC.Offset;
|
||||
|
||||
if (auto hBase = HINSTANCE(SymGetModuleBase64(hProcess, frame.AddrPC.Offset)))
|
||||
{
|
||||
tFrame.m_pBase = uintptr_t(hBase);
|
||||
tFrame.m_uBase = uintptr_t(hBase);
|
||||
|
||||
char buffer[MAX_PATH];
|
||||
if (GetModuleBaseName(hProcess, hBase, buffer, sizeof(buffer) / sizeof(char)))
|
||||
tFrame.m_sModule = buffer;
|
||||
else
|
||||
tFrame.m_sModule = std::format("{:#x}", tFrame.m_pBase);
|
||||
tFrame.m_sModule = std::format("{:#x}", tFrame.m_uBase);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -121,10 +121,10 @@ static LONG APIENTRY ExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo)
|
||||
{
|
||||
for (auto& tFrame : vTrace)
|
||||
{
|
||||
if (tFrame.m_pBase)
|
||||
ssErrorStream << std::format("{}+{:#x}", tFrame.m_sModule, tFrame.m_pAddress - tFrame.m_pBase);
|
||||
if (tFrame.m_uBase)
|
||||
ssErrorStream << std::format("{}+{:#x}", tFrame.m_sModule, tFrame.m_uAddress - tFrame.m_uBase);
|
||||
else
|
||||
ssErrorStream << std::format("{:#x}", tFrame.m_pAddress);
|
||||
ssErrorStream << std::format("{:#x}", tFrame.m_uAddress);
|
||||
if (!tFrame.m_sFile.empty())
|
||||
ssErrorStream << std::format(" ({} L{})", tFrame.m_sFile, tFrame.m_uLine);
|
||||
if (!tFrame.m_sName.empty())
|
||||
|
||||
@@ -104,4 +104,18 @@ PVOID CMemory::FindInterface(const char* szModule, const char* szObject)
|
||||
return nullptr;
|
||||
|
||||
return fnCreateInterface(szObject, nullptr);
|
||||
}
|
||||
|
||||
std::string CMemory::GetModuleOffset(uintptr_t uAddress)
|
||||
{
|
||||
HMODULE hModule;
|
||||
if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, LPCSTR(uAddress), &hModule))
|
||||
return std::format("{:#x}", uAddress);
|
||||
|
||||
uintptr_t uBase = uintptr_t(hModule);
|
||||
char buffer[MAX_PATH];
|
||||
if (!GetModuleBaseName(GetCurrentProcess(), hModule, buffer, sizeof(buffer) / sizeof(char)))
|
||||
return std::format("{:#x}+{:#x}", uBase, uAddress - uBase);
|
||||
|
||||
return std::format("{}+{:#x}", buffer, uAddress - uBase);
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <Windows.h>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class CMemory
|
||||
{
|
||||
@@ -11,6 +12,7 @@ public:
|
||||
std::vector<int> PatternToInt(const char* szPattern);
|
||||
uintptr_t FindSignature(const char* szModule, const char* szPattern);
|
||||
PVOID FindInterface(const char* szModule, const char* szObject);
|
||||
std::string GetModuleOffset(uintptr_t uAddress);
|
||||
|
||||
inline void* GetVirtual(void* p, size_t i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user