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

Split card handling added to cmc filter #3090

Merged

Conversation

Vafthrudnir
Copy link
Contributor

Related Ticket(s)

Short roundup of the initial problem

CMC filter didn't work on split cards in the deck builder

Screenshots

split_card_filter

@tooomm
Copy link
Member

tooomm commented Feb 7, 2018

I found a very similar issue than #3071 --> #2546

Will test both with this PR later today.

Copy link
Member

@Daenyth Daenyth left a comment

Choose a reason for hiding this comment

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

Super clean. You are on fire @Vafthrudnir !

@Vafthrudnir
Copy link
Contributor Author

Thanks @Daenyth !
Rarity filter still doesn't work on split cards, because rarity isn't saved for them to the cards.xml for some reason. The rest seemed to be ok.

// if conversion failed, check for the "//" separator used in split cards
if (!convertSuccess) {
int cmcSum = 0;
foreach (QString cmc, info->getCmc().split("//")) {
Copy link
Member

@ZeldaZach ZeldaZach Feb 7, 2018

Choose a reason for hiding this comment

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

can you change this to for (QString cmc : info->getCMC().split("//")) { ? I'm trying to remove the foreach from the codebase as it's not proper C++

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Member

Choose a reason for hiding this comment

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

We should see if we can add a custom lint rule to codacy

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.

Works great!

@ZeldaZach ZeldaZach merged commit 501e82f into Cockatrice:master Feb 7, 2018
@Vafthrudnir Vafthrudnir deleted the hotfix/3071_cmc_for_split_cards branch February 7, 2018 16:38
@tooomm tooomm mentioned this pull request Feb 7, 2018
2 tasks
@tooomm
Copy link
Member

tooomm commented Feb 7, 2018

Rarity filter still doesn't work on split cards, because rarity isn't saved for them to the cards.xml for some reason. The rest seemed to be ok.

Good that you mention something like that, I guess we were not aware of that as of now. Thanks :)
Issue created: #3091

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.

None yet

4 participants