mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
* MWSDeckImporter - Fixed bug that could find the wrong card (fixes #609).
This commit is contained in:
parent
74e0f76b1a
commit
4a2be2c3e6
1 changed files with 7 additions and 7 deletions
|
@ -63,16 +63,16 @@ public class MWSDeckImporter extends DeckImporter {
|
|||
String lineName = line.substring(delim + 1).trim();
|
||||
try {
|
||||
int num = Integer.parseInt(lineNum);
|
||||
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.name(lineName);
|
||||
criteria.setCodes(setCode);
|
||||
List<CardInfo> cards = CardRepository.instance.findCards(criteria);
|
||||
if (cards.isEmpty()) {
|
||||
criteria = new CardCriteria();
|
||||
List<CardInfo> cards = null;
|
||||
if (!setCode.isEmpty()) {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.name(lineName);
|
||||
criteria.setCodes(setCode);
|
||||
cards = CardRepository.instance.findCards(criteria);
|
||||
}
|
||||
if (cards == null || cards.isEmpty()) {
|
||||
cards = CardRepository.instance.findCards(lineName);
|
||||
}
|
||||
|
||||
if (cards.isEmpty()) {
|
||||
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");
|
||||
|
|
Loading…
Reference in a new issue