Game: fixed that search by card name was able to return a wrong card (example: cheat command)

This commit is contained in:
Oleg Agafonov 2023-05-08 22:58:30 +04:00
parent 6144dc64b7
commit 1dea98cf1f
13 changed files with 39 additions and 52 deletions

View file

@ -154,9 +154,11 @@ public class AddLandDialog extends MageDialog {
criteria.ignoreSetsWithSnowLands();
}
if (mode == DeckEditorMode.FREE_BUILDING && expansionInfo != null && CardRepository.haveSnowLands(expansionInfo.getCode())) {
criteria.name(landName); // snow basics added only if in free mode and the chosen set has exclusively snow basics
// snow basics added only if in free mode and the chosen set has exclusively snow basics
// use contains to find snow lands too
criteria.nameContains(landName);
} else {
criteria.nameExact(landName);
criteria.name(landName);
}
criteria.rarities(Rarity.LAND);
List<CardInfo> cards = CardRepository.instance.findCards(criteria);