From e2730286f4c0942b3f6086b15169c632ab93cfee Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sat, 21 Jul 2018 14:24:56 +0200 Subject: [PATCH] Autounzoom fix Fixed autounzoom having a fixed unzoom time instead of a dynamic time. --- src/hacks/Aimbot.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index cf1a7a21..36a6ad43 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -173,6 +173,8 @@ float cur_proj_grav{ 0.0f }; // If slow aimbot allows autoshoot bool slow_can_shoot = false; bool projectileAimbotRequired; +// Keep track of our zoom time +Timer zoomTime{}; // This array will store calculated projectile/hitscan predictions // for current frame, to avoid performing them again @@ -252,13 +254,9 @@ void CreateMove() // Auto-Unzoom if (auto_unzoom) { - if (g_pLocalPlayer->holding_sniper_rifle) + if (g_pLocalPlayer->holding_sniper_rifle && g_pLocalPlayer->bZoomed && zoomTime.check(3000)) { - if (g_pLocalPlayer->bZoomed) - { - if (g_GlobalVars->curtime - g_pLocalPlayer->flZoomBegin > 5.0f) g_pUserCmd->buttons |= IN_ATTACK2; - } } } // We do this as we need to pass whether the aimkey allows aiming to both @@ -276,6 +274,7 @@ void CreateMove() { if (g_pLocalPlayer->holding_sniper_rifle) { + zoomTime.update(); if (not g_pLocalPlayer->bZoomed) { g_pUserCmd->buttons |= IN_ATTACK2;