diff --git a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp index 2418365a..adf80779 100644 --- a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp @@ -654,7 +654,7 @@ std::vector CAimbotProjectile::GetSplashPoints(Target_t& tTarget, std:: return false; bErase = tPoint.m_tSolution.m_iCalculated == CalculatedEnum::Good; - if (!bErase || !m_tInfo.m_flPrimeTime && int(tPoint.m_tSolution.m_flTime / TICK_INTERVAL) + 1 != iSimTime) + if (!bErase /*|| !m_tInfo.m_flPrimeTime && int(tPoint.m_tSolution.m_flTime / TICK_INTERVAL) + 1 != iSimTime*/) return false; vPointDistances.emplace_back(tPoint, tPoint.m_vPoint.DistTo(tTarget.m_vPos)); @@ -788,7 +788,7 @@ std::vector CAimbotProjectile::GetSplashPointsSimple(Target_t& tTarget, CalculateAngle(m_tInfo.m_vLocalEye, tPoint.m_vPoint, iSimTime, tPoint.m_tSolution); bErase = tPoint.m_tSolution.m_iCalculated == CalculatedEnum::Good; - if (!bErase || !m_tInfo.m_flPrimeTime && int(tPoint.m_tSolution.m_flTime / TICK_INTERVAL) + 1 != iSimTime) + if (!bErase /*|| !m_tInfo.m_flPrimeTime && int(tPoint.m_tSolution.m_flTime / TICK_INTERVAL) + 1 != iSimTime*/) return false; vPointDistances.emplace_back(tPoint, tPoint.m_vPoint.DistTo(tTarget.m_vPos)); @@ -1169,7 +1169,8 @@ bool CAimbotProjectile::TestAngle(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, Tar F::ProjSim.SetupTrace(filter, nMask, pWeapon); #ifdef SPLASH_DEBUG5 - G::BoxStorage.emplace_back(vPoint, tProjInfo.m_vHull * -1, tProjInfo.m_vHull, Vec3(), I::GlobalVars->curtime + 5.f, Color_t(255, 0, 0), Color_t(0, 0, 0, 0)); + Vec3 vHull = tProjInfo.m_vHull.Max(1); + G::BoxStorage.emplace_back(vPoint, vHull * -1, vHull, Vec3(), I::GlobalVars->curtime + 5.f, Color_t(255, 0, 0), Color_t(0, 0, 0, 0)); #endif if (!tProjInfo.m_flGravity) @@ -1269,10 +1270,10 @@ bool CAimbotProjectile::TestAngle(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, Tar #ifdef SPLASH_DEBUG5 G::BoxStorage.pop_back(); if (bValid) - G::BoxStorage.emplace_back(vPoint, tProjInfo.m_vHull * -1, tProjInfo.m_vHull, Vec3(), I::GlobalVars->curtime + 5.f, Color_t(0, 255, 0), Color_t(0, 0, 0, 0)); + G::BoxStorage.emplace_back(vPoint, vHull * -1, vHull, Vec3(), I::GlobalVars->curtime + 5.f, Color_t(0, 255, 0), Color_t(0, 0, 0, 0)); else if (!bTime) { - G::BoxStorage.emplace_back(vPoint, tProjInfo.m_vHull * -1, tProjInfo.m_vHull, Vec3(), I::GlobalVars->curtime + 5.f, Color_t(255, 0, 255), Color_t(0, 0, 0, 0)); + G::BoxStorage.emplace_back(vPoint, vHull * -1, vHull, Vec3(), I::GlobalVars->curtime + 5.f, Color_t(255, 0, 255), Color_t(0, 0, 0, 0)); if (bSplash) { G::BoxStorage.emplace_back(trace.endpos, Vec3(-1, -1, -1), Vec3(1, 1, 1), Vec3(), I::GlobalVars->curtime + 5.f, Color_t(0, 0, 0), Color_t(0, 0, 0, 0)); @@ -1280,7 +1281,7 @@ bool CAimbotProjectile::TestAngle(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, Tar } } else - G::BoxStorage.emplace_back(vPoint, tProjInfo.m_vHull * -1, tProjInfo.m_vHull, Vec3(), I::GlobalVars->curtime + 5.f, Color_t(0, 0, 255), Color_t(0, 0, 0, 0)); + G::BoxStorage.emplace_back(vPoint, vHull * -1, vHull, Vec3(), I::GlobalVars->curtime + 5.f, Color_t(0, 0, 255), Color_t(0, 0, 0, 0)); #endif if (bValid) diff --git a/Amalgam/src/Hooks/CBasePlayer_CalcViewModelView.cpp b/Amalgam/src/Hooks/CBasePlayer_CalcViewModelView.cpp index 94892b8b..f2777286 100644 --- a/Amalgam/src/Hooks/CBasePlayer_CalcViewModelView.cpp +++ b/Amalgam/src/Hooks/CBasePlayer_CalcViewModelView.cpp @@ -3,7 +3,7 @@ MAKE_SIGNATURE(CBasePlayer_CalcViewModelView, "client.dll", "48 89 74 24 ? 55 41 56 41 57 48 8D AC 24", 0x0); MAKE_HOOK(CBasePlayer_CalcViewModelView, S::CBasePlayer_CalcViewModelView(), void, - void* rcx, CBaseEntity* pOwner, const Vec3& vEyePosition, Vec3& vEyeAngles) + void* rcx, CBaseEntity* pOwner, Vec3& vEyePosition, Vec3& vEyeAngles) { #ifdef DEBUG_HOOKS if (!Vars::Hooks::CBasePlayer_CalcViewModelView[DEFAULT_BIND]) @@ -17,14 +17,7 @@ MAKE_HOOK(CBasePlayer_CalcViewModelView, S::CBasePlayer_CalcViewModelView(), voi || Vars::Visuals::UI::CleanScreenshots.Value && I::EngineClient->IsTakingScreenshot()) return CALL_ORIGINAL(rcx, pOwner, vEyePosition, vEyeAngles); - bool bFlip = false; - { - static auto cl_flipviewmodels = U::ConVars.FindVar("cl_flipviewmodels"); - if (cl_flipviewmodels->GetBool()) - bFlip = !bFlip; - if (G::FlipViewmodels) - bFlip = !bFlip; - } + bool bFlip = G::FlipViewmodels; if (Vars::Visuals::Viewmodel::ViewmodelAim.Value) { @@ -38,13 +31,12 @@ MAKE_HOOK(CBasePlayer_CalcViewModelView, S::CBasePlayer_CalcViewModelView(), voi } } - Vec3 vNewEyePosition = vEyePosition; if (bOffset) { Vec3 vForward, vRight, vUp; Math::AngleVectors(vEyeAngles, &vForward, &vRight, &vUp); - vNewEyePosition += vForward * vOffset.y; - vNewEyePosition += vRight * vOffset.x * (bFlip ? -1 : 1); - vNewEyePosition += vUp * vOffset.z; + vEyePosition += vForward * vOffset.y; + vEyePosition += vRight * vOffset.x * (bFlip ? -1 : 1); + vEyePosition += vUp * vOffset.z; } if (Vars::Visuals::Viewmodel::Pitch.Value) vEyeAngles.x += Vars::Visuals::Viewmodel::Pitch.Value; @@ -53,5 +45,5 @@ MAKE_HOOK(CBasePlayer_CalcViewModelView, S::CBasePlayer_CalcViewModelView(), voi if (Vars::Visuals::Viewmodel::Roll.Value) vEyeAngles.z += Vars::Visuals::Viewmodel::Roll.Value * (bFlip ? -1 : 1); - CALL_ORIGINAL(rcx, pOwner, vNewEyePosition, vEyeAngles); + CALL_ORIGINAL(rcx, pOwner, vEyePosition, vEyeAngles); } \ No newline at end of file diff --git a/Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp b/Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp index ec59ed84..e1940e59 100644 --- a/Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp +++ b/Amalgam/src/Hooks/Cbuf_ExecuteCommand.cpp @@ -256,9 +256,35 @@ MAKE_HOOK(Cbuf_ExecuteCommand, S::Cbuf_ExecuteCommand(), void, s_sCmdString = std::format("{} {}", sCommand, s_sCmdString).substr(0, COMMAND_MAX_LENGTH - 1); strncpy_s(args.m_pArgSBuffer, s_sCmdString.c_str(), COMMAND_MAX_LENGTH); args.m_nArgv0Size = int(strlen(sCommand)) + 1; + + break; } + case FNV1A::Hash32Const("cl_flipviewmodels"): + { // server does string comparison to "1" + auto pCVar = I::CVar->FindVar(sCommand); + if (!pCVar) + break; + + CALL_ORIGINAL(args, source); + + try + { + if (pCVar->GetFloat() != float(std::stoi(pCVar->GetString()))) + break; + + auto sValue = std::format("{}", pCVar->GetInt()); + if (FNV1A::Hash32(sValue.c_str()) == FNV1A::Hash32(pCVar->GetString())) + break; + + pCVar->SetValue(sValue.c_str()); + SDK::Output("Cbuf_ExecuteCommand", std::format("{}: {}, {}, {}", sCommand, pCVar->GetString(), pCVar->GetFloat(), pCVar->GetInt()).c_str()); + } + catch (...) {} + + return; + } } } - CALL_ORIGINAL(args, source); + CALL_ORIGINAL(args, source); } \ No newline at end of file diff --git a/Amalgam/src/SDK/SDK.cpp b/Amalgam/src/SDK/SDK.cpp index fce7ae31..e3ec4aeb 100644 --- a/Amalgam/src/SDK/SDK.cpp +++ b/Amalgam/src/SDK/SDK.cpp @@ -786,7 +786,7 @@ void SDK::WalkTo(CUserCmd* pCmd, CTFPlayer* pLocal, Vec3& vTo, float flScale) void SDK::GetProjectileFireSetup(CTFPlayer* pPlayer, const Vec3& vAngIn, Vec3 vOffset, Vec3& vPosOut, Vec3& vAngOut, bool bPipes, bool bInterp, bool bAllowFlip) { static auto cl_flipviewmodels = U::ConVars.FindVar("cl_flipviewmodels"); - if (bAllowFlip && cl_flipviewmodels->GetBool()) + if (bAllowFlip && FNV1A::Hash32(cl_flipviewmodels->GetString()) == FNV1A::Hash32Const("1")) vOffset.y *= -1.f; const Vec3 vShootPos = bInterp ? pPlayer->GetEyePosition() : pPlayer->GetShootPos(); diff --git a/Amalgam/src/SDK/Vars.h b/Amalgam/src/SDK/Vars.h index f9acb220..16aab991 100644 --- a/Amalgam/src/SDK/Vars.h +++ b/Amalgam/src/SDK/Vars.h @@ -360,8 +360,8 @@ namespace Vars CVar(HuntsmanClamp, "Huntsman clamp", 5.f, NOSAVE | DEBUGVAR | SLIDER_CLAMP | SLIDER_PRECISION, 0.f, 10.f, 0.5f); CVar(HuntsmanPullPoint, "Huntsman pull point", false, NOSAVE | DEBUGVAR); - CVar(SplashPointsDirect, "Direct splash points", 100, NOSAVE | DEBUGVAR | SLIDER_MIN, 1, 400, 5); - CVar(SplashPointsArc, "Arc splash points", 100, NOSAVE | DEBUGVAR | SLIDER_MIN, 1, 400, 5); + CVar(SplashPointsDirect, "Direct splash points", 100, NOSAVE | DEBUGVAR | SLIDER_MIN, 0, 400, 5); + CVar(SplashPointsArc, "Arc splash points", 100, NOSAVE | DEBUGVAR | SLIDER_MIN, 0, 400, 5); CVar(SplashCountDirect, "Direct splash count", 100, NOSAVE | DEBUGVAR | SLIDER_MIN, 1, 100); CVar(SplashCountArc, "Arc splash count", 5, NOSAVE | DEBUGVAR | SLIDER_MIN, 1, 100); CVar(SplashRotateX, "Splash Rx", -1.f, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, -1.f, 360.f); diff --git a/Amalgam/src/Utils/Timer/Timer.cpp b/Amalgam/src/Utils/Timer/Timer.cpp index 11e348ce..e20c3be4 100644 --- a/Amalgam/src/Utils/Timer/Timer.cpp +++ b/Amalgam/src/Utils/Timer/Timer.cpp @@ -23,7 +23,7 @@ bool Timer::Run(float flS) return false; } -inline void Timer::Update() +void Timer::Update() { m_flLast = SDK::PlatFloatTime(); } \ No newline at end of file diff --git a/Amalgam/src/Utils/Timer/Timer.h b/Amalgam/src/Utils/Timer/Timer.h index 2f62be81..add75e4d 100644 --- a/Amalgam/src/Utils/Timer/Timer.h +++ b/Amalgam/src/Utils/Timer/Timer.h @@ -9,5 +9,5 @@ public: Timer(); bool Check(float flS) const; bool Run(float flS); - inline void Update(); + void Update(); }; \ No newline at end of file