Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to some std::sort calls #3967

Merged
merged 2 commits into from
Apr 23, 2020
Merged

Conversation

Olxinos
Copy link
Contributor

@Olxinos Olxinos commented Apr 23, 2020

Related Ticket(s)

Short roundup of the initial problem

A few (3) calls to std::sort fed it a non-strict comparison operator. However, the standard requires the comparison to be strict. Depending on the standard library with which Cockatrice was compiled, those calls were prone to crashes (e.g. on Mac OSX with apple clang and libc++).
Two of these comparison operators were also incorrectly reversed (causing a minor bug in the manage sets dialog, c.f. screenshots for an example).

What will change with this Pull Request?

Screenshots

example of the manage sets bug:
movedownscramble
Clicking on "move down" with the second and third row selected swapped the 2nd and 3rd row, then the 3rd and 4th row (and added the 3rd row to the selection) instead of swapping the 3rd and 4th row before swapping the 2nd and 3rd row.

Copy link
Member

@ZeldaZach ZeldaZach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Looks good on my end

@ZeldaZach ZeldaZach merged commit db85ec4 into Cockatrice:master Apr 23, 2020
@Olxinos Olxinos deleted the sortfix branch September 7, 2020 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashing When Trying to Load Deck
2 participants