Fix bug with double suits being able to outbid double joker #442
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug: Currently this bidding sequence at rank 2 is possible: 1x2D -> 2xLJ -> 2xHJ -> 2x2S -> 2xHJ -> 2x2H -> 2xHJ etc
Expected behaviour: Double of any suit should not be able to outbid double jokers
Actual behaviour: Double of any suit can outbid double jokers, so bidding can become an infinite loop
This is because in the fallback condition
new_bid.card.suit() > existing_bid.card.suit()
, jokers have a none value or something, so any suit is considered higher, so I added an additional condition before that.Separately, currently this behaviour is enforced:
The new bid count must have a size of at least 2 in order to be compared by suit ranking
, so you can't have 1x2D -> 1x2S. I've never heard of this condition though, my gaming groups have always allowed that, and this behaviour is not expected from the option descriptionJoker or higher suit bids to outbid non-joker bids with the same number of cards
. Would it be okay if I add a new option for that and update the text of the current one?