Skip to content

Commit

Permalink
fix: Select window abort with 0 selection_count
Browse files Browse the repository at this point in the history
Fixes #283
  • Loading branch information
db0 committed Apr 11, 2022
1 parent edf1036 commit 473b726
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/SelectionWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ func initiate_selection(
is_cancelled = true
emit_signal("confirmed")
return
# If the selection count is 0 (e.g. reduced with an alterant)
# And we're looking for max or equal amount of cards, we return cancelled.
elif selection_count == 0\
and selection_type in ["equal", "max"]:
selected_cards = []
is_cancelled = true
emit_signal("confirmed")
return
# If the amount of cards available for the choice are exactly the requirements
# And we're looking for equal or minimum amount
# We immediately return what is there.
Expand Down

0 comments on commit 473b726

Please sign in to comment.