Skip to content

Commit

Permalink
fix: Release shift in case of out of gold (aeon0#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeon0 authored Apr 30, 2022
1 parent e32e825 commit 9f11c33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/inventory/vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit 9f11c33

Please sign in to comment.