fix(editor): exportZone preserves user displayName + dedupes tile list

Two related zone-manifest bugs:
1. displayName was always overwritten with the .adt prefix on every
   export, throwing away whatever the user typed in the Zone Metadata
   panel.
2. tiles vector was push_back'd to without clearing, so re-exporting the
   same zone would accumulate duplicate tile entries.

Both fixed by checking displayName.empty() before assignment and calling
tiles.clear() before the rebuild loop.
This commit is contained in:
Kelsi 2026-05-06 03:42:54 -07:00
parent 28c63cb6d9
commit f9187ef58a

View file

@ -1291,7 +1291,10 @@ void EditorApp::exportZone(const std::string& outputDir) {
// Scan output directory for all exported tiles (includes adjacent tiles)
ZoneManifest& manifest = zoneManifest_;
manifest.mapName = loadedMap_;
manifest.displayName = loadedMap_;
// Preserve user-set displayName from the Zone Metadata panel; only fill in
// the default when the user hasn't customized it.
if (manifest.displayName.empty()) manifest.displayName = loadedMap_;
manifest.tiles.clear();
manifest.tiles.push_back({loadedTileX_, loadedTileY_});
namespace fs = std::filesystem;
if (fs::exists(base)) {