fix: Release shift in case of out of gold (#740)

This commit is contained in:
aeon0
2022-05-01 00:56:42 +02:00
committed by GitHub
parent e156671b17
commit 886fc88816
+2 -1
View File
@@ -118,6 +118,7 @@ def buy_item(template_name: str, quantity: int = 1, img: np.ndarray = None, shif
wait(0.4, 0.6)
if is_visible(ScreenObjects.NotEnoughGold):
Logger.warning(f"Out of gold, could not purchase {template_name}")
keyboard.send('shift', do_release=True)
keyboard.send("esc")
return False
keyboard.send('shift', do_release=True)
@@ -138,4 +139,4 @@ def buy_item(template_name: str, quantity: int = 1, img: np.ndarray = None, shif
return False
Logger.error(f"buy_item: Desired item {template_name} not found")
return False
return False