Fix duplicated maps writing the wrong name

This commit is contained in:
GriffinR 2025-05-29 22:18:44 -04:00
parent 4816c1c8af
commit 560d204890
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ and this project somewhat adheres to [Semantic Versioning](https://semver.org/sp
- The scale of the map can now be changed while resizing the map.
### Fixed
- Fix duplicated maps writing the wrong name.
- Fix small maps being difficult to see while resizing.
## [6.0.0] - 2025-05-26

View File

@ -405,6 +405,10 @@ bool Project::loadMapData(Map* map) {
}
QJsonObject mapObj = mapDoc.object();
QString name = ParseUtil::jsonToQString(mapObj.take("name"));
if (name != map->name()) {
logWarn(QString("Mismatched name '%1' for map '%2' will be overwritten.").arg(name).arg(map->name()));
}
// We should already know the map constant ID from the initial project launch, but we'll ensure it's correct here anyway.
map->setConstantName(ParseUtil::jsonToQString(mapObj.take("id")));