From c6bb52905703883cfae1141d0dde0b48e5cd3e83 Mon Sep 17 00:00:00 2001 From: Viceroy <97338859+Viceroyy@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:44:48 +0300 Subject: [PATCH] Fix passive tick recharge by @rei-2 Welcome back --- Fusion/src/Features/TickHandler/TickHandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Fusion/src/Features/TickHandler/TickHandler.cpp b/Fusion/src/Features/TickHandler/TickHandler.cpp index 1ff610f..e7dfdd0 100644 --- a/Fusion/src/Features/TickHandler/TickHandler.cpp +++ b/Fusion/src/Features/TickHandler/TickHandler.cpp @@ -14,11 +14,12 @@ void CTickshiftHandler::Recharge(CUserCmd* pCmd, CTFPlayer* pLocal) { bool bPassive = G::Recharge = false; - static float iPassiveTick = 0.f; - if (Vars::CL_Move::Doubletap::PassiveRecharge.Value && I::GlobalVars->tickcount >= iPassiveTick) + static float flPassiveTime = 0.f; + flPassiveTime = std::max(flPassiveTime - TICK_INTERVAL, -TICK_INTERVAL); + if (Vars::CL_Move::Doubletap::PassiveRecharge.Value && 0.f >= flPassiveTime) { bPassive = true; - iPassiveTick = I::GlobalVars->tickcount + 67 - Vars::CL_Move::Doubletap::PassiveRecharge.Value; + flPassiveTime += 1.f / Vars::CL_Move::Doubletap::PassiveRecharge.Value; } if (iDeficit && G::ShiftedTicks < G::MaxShift)