Fix regex in readNamedIndexCArray() that disallowed 0 in the name

This commit is contained in:
Marcus Huderle 2020-12-13 17:05:28 -06:00
parent dfe3b2d519
commit 583ee23a15
2 changed files with 2 additions and 1 deletions

View file

@ -29,6 +29,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
- Fix porymap icon not showing on window or panel on Linux.
- The main window can now be resized to fit on lower resolution displays.
- Zooming the map in/out will now focus on the cursor.
- Fix bug where object event sprites whose name contained a 0 character would display the placeholder "N" picture.
## [4.3.1] - 2020-07-17
### Added

View file

@ -337,7 +337,7 @@ QMap<QString, QString> ParseUtil::readNamedIndexCArray(QString filename, QString
QRegularExpression re_text(QString(R"(\b%1\b\s*(\[?[^\]]*\])?\s*=\s*\{([^\}]*)\})").arg(label));
QString body = re_text.match(text).captured(2).replace(QRegularExpression("\\s*"), "");
QRegularExpression re("\\[(?<index>[A-Za-z1-9_]*)\\]=(?<value>&?[A-Za-z1-9_]*)");
QRegularExpression re("\\[(?<index>[A-Za-z0-9_]*)\\]=(?<value>&?[A-Za-z0-9_]*)");
QRegularExpressionMatchIterator iter = re.globalMatch(body);
while (iter.hasNext()) {