mirror of
https://github.com/rei-2/Amalgam.git
synced 2026-10-12 02:08:13 +08:00
slightly rework attacking logic
This commit is contained in:
1 parent
1f5c90ac68
commit
5fd2ab69d6
5 files changed
+13
-6
No files matched your search
@@ -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);
|
||||
}
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user