mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-10 18:05:34 -05:00
Silence errors about SECRET_BASE_GROUP
This commit is contained in:
@@ -2218,10 +2218,15 @@ bool Project::readSecretBaseIds() {
|
||||
if (!projectConfig.getEventSecretBaseEnabled())
|
||||
return true;
|
||||
|
||||
// SECRET_BASE_GROUP is a function-like macro, which Porymap can't handle.
|
||||
// Redefine it so Porymap won't produce spurious errors about failing to parse it.
|
||||
QMap<QString, int> knownDefines = QMap<QString, int>();
|
||||
knownDefines.insert("SECRET_BASE_GROUP", 0);
|
||||
|
||||
QStringList prefixes("\\bSECRET_BASE_[A-Za-z0-9_]*_[0-9]+");
|
||||
QString filename = "include/constants/secret_bases.h";
|
||||
fileWatcher.addPath(root + "/" + filename);
|
||||
secretBaseIds = parser.readCDefinesSorted(filename, prefixes);
|
||||
secretBaseIds = parser.readCDefinesSorted(filename, prefixes, knownDefines);
|
||||
if (secretBaseIds.isEmpty()) {
|
||||
logError(QString("Failed to read secret base id constants from %1").arg(filename));
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user