replace cipt check with regex (#5094)

This commit is contained in:
ebbit1q
2024-08-25 02:31:01 +02:00
committed by GitHub
parent 95cd1c6f87
commit bbe125beee

View File

@@ -141,9 +141,9 @@ CardInfoPtr OracleImporter::addCard(QString name,
// DETECT CARD POSITIONING INFO
// cards that enter the field tapped
bool cipt = text.contains(" it enters the battlefield tapped") ||
(text.contains(name + " enters the battlefield tapped") &&
!text.contains(name + " enters the battlefield tapped unless"));
QRegularExpression ciptRegex("( it|" + QRegularExpression::escape(name) +
") enters( the battlefield)? tapped(?! unless)");
bool cipt = ciptRegex.match(text).hasMatch();
// table row
int tableRow = 1;