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

Import Parses Tyrannax Rex Incorrectly #5941

Open
EminentEmily opened this issue Aug 16, 2024 · 3 comments
Open

Import Parses Tyrannax Rex Incorrectly #5941

EminentEmily opened this issue Aug 16, 2024 · 3 comments
Assignees
Labels
keep no stale

Comments

@EminentEmily
Copy link

Describe the bug
When using the Import Feature, the importer interprets the "Rex" in "Tyrannax Rex" as a set, instead of part of its name. Adding the card via Card Catalog works normally.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Deck Editor
  2. Click on Import
  3. Input "1 Tyrannax Rex" as a card to import
  4. The importer displays "Tyrannax [Rex]" and of course doesn't fetch the card.

Expected behavior
The importer should recognize Tyrannax Rex as the name of the card, not interpret "Rex" as a set.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Version 1.6.64

Additional context
I'm only a amateur programmer myself and a bit of a novice, but I suspect the fact that "Rex" has three letters might be what's causing the parser to trip and think it's a set code?

@tehdiplomat
Copy link
Contributor

This is a known issue. It's because REX is an actual set code.

@Hanmac
Copy link
Contributor

Hanmac commented Aug 28, 2024

@tehdiplomat can we somehow prioritize full string "Tyrannax Rex" as Cardname before checking if "Rex" could be a SetCode?

@Jetz72
Copy link
Contributor

Jetz72 commented Aug 28, 2024

Looking at the order the DeckRecognizer does things in, a fallback might be simpler than changing the order the patterns are checked in. Maybe something similar to the one for double faced cards?

if (!data.isMTGCard(cardName)){
// check the case for double-sided cards
cardName = checkDoubleSidedCard(cardName);
}

So if the name isn't a real card but there's a set code, see if tacking the set code onto the name makes it a real card, and if so, proceed from there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep no stale
Projects
None yet
Development

No branches or pull requests

5 participants