diff --git a/Amalgam/src/Features/Aimbot/Aimbot.cpp b/Amalgam/src/Features/Aimbot/Aimbot.cpp index 38eaa00b..1fea22b5 100644 --- a/Amalgam/src/Features/Aimbot/Aimbot.cpp +++ b/Amalgam/src/Features/Aimbot/Aimbot.cpp @@ -54,7 +54,7 @@ void CAimbot::RunAimbot(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCm G::CanPrimaryAttack = bOriginal; } -void CAimbot::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd) +void CAimbot::RunMain(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd) { if (F::AimbotProjectile.m_bLastTickCancel) { @@ -81,3 +81,10 @@ void CAimbot::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd) RunAimbot(pLocal, pWeapon, pCmd); RunAimbot(pLocal, pWeapon, pCmd, true); } + +void CAimbot::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd) +{ + RunMain(pLocal, pWeapon, pCmd); + + G::Attacking = SDK::IsAttacking(pLocal, pWeapon, pCmd, true); +} \ No newline at end of file diff --git a/Amalgam/src/Features/Aimbot/Aimbot.h b/Amalgam/src/Features/Aimbot/Aimbot.h index c3301820..d34ff5ff 100644 --- a/Amalgam/src/Features/Aimbot/Aimbot.h +++ b/Amalgam/src/Features/Aimbot/Aimbot.h @@ -5,6 +5,7 @@ class CAimbot { private: bool ShouldRun(CTFPlayer* pLocal, CTFWeaponBase* pWeapon); + void RunMain(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd); void RunAimbot(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bool bSecondaryType = false); public: diff --git a/Amalgam/src/Features/CritHack/CritHack.cpp b/Amalgam/src/Features/CritHack/CritHack.cpp index c0e6e42f..e2482671 100644 --- a/Amalgam/src/Features/CritHack/CritHack.cpp +++ b/Amalgam/src/Features/CritHack/CritHack.cpp @@ -324,7 +324,6 @@ void CCritHack::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd) auto& tStorage = m_mStorage[iSlot]; - G::Attacking = SDK::IsAttacking(pLocal, pWeapon, pCmd, false); if (pWeapon->GetWeaponID() == TF_WEAPON_MINIGUN && pCmd->buttons & IN_ATTACK) pCmd->buttons &= ~IN_ATTACK2; diff --git a/Amalgam/src/Features/ImGui/Menu/Menu.cpp b/Amalgam/src/Features/ImGui/Menu/Menu.cpp index 282c4203..f2433ca0 100644 --- a/Amalgam/src/Features/ImGui/Menu/Menu.cpp +++ b/Amalgam/src/Features/ImGui/Menu/Menu.cpp @@ -80,14 +80,14 @@ void CMenu::DrawMenu() Bind_t tBind; if (F::Binds.GetBind(CurrentBind, &tBind)) { - const auto textSize = FCalcTextSize(std::format("Editing for condition {}", tBind.Name).c_str()); + const auto textSize = FCalcTextSize(std::format("Editing bind {}", tBind.Name).c_str()); SetNextWindowSize({ std::clamp(textSize.x + H::Draw.Scale(56), H::Draw.Scale(40), vMainWindowSize.x), H::Draw.Scale(40) }); SetNextWindowPos({ vMainWindowPos.x, vMainWindowPos.y + vMainWindowSize.y + H::Draw.Scale(8) }); if (Begin("Bind", nullptr, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar)) { - const auto preSize = FCalcTextSize("Editing for condition "); + const auto preSize = FCalcTextSize("Editing bind "); SetCursorPos({ H::Draw.Scale(16), H::Draw.Scale(13) }); - FText("Editing for condition "); + FText("Editing bind "); SetCursorPos({ H::Draw.Scale(16) + preSize.x, H::Draw.Scale(13) }); PushStyleColor(ImGuiCol_Text, F::Render.Accent.Value); FText(tBind.Name.c_str()); diff --git a/Amalgam/src/SDK/SDK.cpp b/Amalgam/src/SDK/SDK.cpp index a58f1527..d59ab000 100644 --- a/Amalgam/src/SDK/SDK.cpp +++ b/Amalgam/src/SDK/SDK.cpp @@ -411,7 +411,7 @@ const char* SDK::GetClassByIndex(const int nClass) int SDK::IsAttacking(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, const CUserCmd* pCmd, bool bTickBase) { - if (pCmd->weaponselect) + if (!pLocal || !pWeapon || pCmd->weaponselect) return false; int iTickBase = bTickBase ? I::GlobalVars->tickcount : pLocal->m_nTickBase();