From ac14bdff24f7ac437c71ac358d842250c092017d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 18 Apr 2023 16:07:09 +0200 Subject: Hopefully fixed garden hotkeys staying toggled when logging off with farming tool in hand --- .../skyhanni/features/garden/farming/GardenCustomKeybinds.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt index 73a336eaa..e5338cebc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt @@ -99,8 +99,11 @@ class GardenCustomKeybinds { } private fun KeyBinding.unpressKeyIfDown() { - if (KeybindHelper.isKeyDown(keyCode)) { - (this as AccessorKeyBinding).skyhanni_unpressKey() + try { + if (KeybindHelper.isKeyDown(keyCode)) { + (this as AccessorKeyBinding).skyhanni_unpressKey() + } + } catch (_: IllegalStateException) { } } -- cgit