From 36b4ffa02dabca42072c7787729a3e600c883442 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 26 Feb 2025 13:23:26 -0500 Subject: [PATCH] Fix changes for unsaved new maps applying to map groups --- src/project.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/project.cpp b/src/project.cpp index 8d19fd02..006e5b63 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -664,6 +664,10 @@ void Project::saveMapGroups() { for (const auto &groupName : this->groupNames) { OrderedJson::array groupArr; for (const auto &mapName : this->groupNameToMapNames.value(groupName)) { + if (this->mapCache.value(mapName) && !this->mapCache.value(mapName)->isPersistedToFile()) { + // This is a new map that hasn't been saved yet, don't add it to the global map groups list yet. + continue; + } groupArr.push_back(mapName); } mapGroupsObj[groupName] = groupArr; @@ -1136,6 +1140,7 @@ void Project::saveMap(Map *map, bool skipLayout) { if (!map->isPersistedToFile()) { if (!QDir::root().mkpath(fullPath)) { logError(QString("Failed to create directory for new map: '%1'").arg(fullPath)); + return; } // Create file data/maps//scripts.inc