From 3fda94a898a8da84419e12d64bfb47c81bc891d1 Mon Sep 17 00:00:00 2001 From: harlanx Date: Tue, 13 Sep 2022 20:48:25 +0800 Subject: [PATCH] Fix attack speed affecting other modules --- cheat-library/src/user/cheat/player/RapidFire.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cheat-library/src/user/cheat/player/RapidFire.cpp b/cheat-library/src/user/cheat/player/RapidFire.cpp index 27d00aa..093729a 100644 --- a/cheat-library/src/user/cheat/player/RapidFire.cpp +++ b/cheat-library/src/user/cheat/player/RapidFire.cpp @@ -370,10 +370,18 @@ namespace cheat::feature } } + static bool isFastSpeed = false; if (rapidFire.f_AttackSpeed && isAttacking) - app::Animator_set_speed(attacker.animator(), rapidFire.f_SpeedMultiplier, nullptr); - else + { + if (!isinf(processStateInfo.m_Length)) + app::Animator_set_speed(attacker.animator(), rapidFire.f_SpeedMultiplier, nullptr); + isFastSpeed = true; + } + else if (IsAttackByAvatar(attacker) && isFastSpeed) { + //LOG_DEBUG("Speed Reverted"); app::Animator_set_speed(attacker.animator(), processStateInfo.m_SpeedMultiplier, nullptr); + isFastSpeed = false; + } CALL_ORIGIN(VCAnimatorEvent_HandleProcessItem_Hook, __this, processItem, processStateInfo, mode, method); }