From e3f6b76fecb6d561d79bba52cd898861d7cc1260 Mon Sep 17 00:00:00 2001 From: Andrei Abrudan Date: Sat, 18 Jun 2022 02:45:34 +0100 Subject: [PATCH] Fixed a bug where multiple trees in range would cause RepeatDelay to be ignored resulting in less wood than expected --- cheat-library/src/user/cheat/world/AutoTreeFarm.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cheat-library/src/user/cheat/world/AutoTreeFarm.cpp b/cheat-library/src/user/cheat/world/AutoTreeFarm.cpp index bee71a3..c1e7874 100644 --- a/cheat-library/src/user/cheat/world/AutoTreeFarm.cpp +++ b/cheat-library/src/user/cheat/world/AutoTreeFarm.cpp @@ -158,7 +158,6 @@ namespace cheat::feature void AutoTreeFarm::OnGameUpdate() { static lra_map s_AttackCountMap; - static std::queue s_AttackQueue; static std::unordered_set s_AttackQueueSet; static uint64_t s_LastAttackTimestamp = 0; @@ -179,7 +178,7 @@ namespace cheat::feature if (s_AttackQueueSet.count(tree) > 0) continue; - if (tree->fields._lastTreeDropTimeStamp + m_RepeatDelay > timestamp) + if (s_LastAttackTimestamp + m_RepeatDelay > timestamp) continue; auto position = tree->fields._.realBounds.m_Center; @@ -220,7 +219,7 @@ namespace cheat::feature continue; } - tree->fields._lastTreeDropTimeStamp = timestamp; + s_LastAttackTimestamp = timestamp; app::MoleMole_NetworkManager_RequestHitTreeDropNotify(networkManager, position, position, treeType, nullptr); break; }