From aab187a1fd095cb4f7244ad3c41dfb46c832b215 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 7 Jan 2024 20:48:53 +0100 Subject: Fixed can not remove nearest pest. --- .../hannibal2/skyhanni/features/garden/pests/PestFinder.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt index ad4f97626..cc7019cf1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt @@ -141,13 +141,13 @@ class PestFinder { } } - resetAllPests(newPests) - - if (newPests == PestAPI.scoreboardPests) return + if (newPests != PestAPI.scoreboardPests) { + removePests(PestAPI.scoreboardPests - newPests) + PestAPI.scoreboardPests = newPests + update() + } - removePests(PestAPI.scoreboardPests - newPests) - PestAPI.scoreboardPests = newPests - update() + resetAllPests(newPests) } // Auto fixing plots marked as pests when killing all pests without SkyHanni earlier. -- cgit