From 826d2182263398d61e90255df9efd582338d91a8 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 07:02:09 -0700 Subject: [PATCH] fix(zone): cap manifest strings at AzerothCore SQL limits map_dbc.MapName / area_table_dbc.AreaName are varchar(100). Edited zone.json could carry longer strings that would either fail the INSERT or silently truncate. Cap mapName/displayName at 100, biome at 64, description at 4096. --- tools/editor/zone_manifest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/editor/zone_manifest.cpp b/tools/editor/zone_manifest.cpp index 458ecd02..8a94af65 100644 --- a/tools/editor/zone_manifest.cpp +++ b/tools/editor/zone_manifest.cpp @@ -85,6 +85,12 @@ bool ZoneManifest::load(const std::string& path) { displayName = j.value("displayName", mapName); biome = j.value("biome", ""); description = j.value("description", ""); + // Cap to AzerothCore map_dbc/area_table_dbc string limits — keeps + // the SQL export valid and the README readable. + if (mapName.size() > 100) mapName.resize(100); + if (displayName.size() > 100) displayName.resize(100); + if (biome.size() > 64) biome.resize(64); + if (description.size() > 4096) description.resize(4096); mapId = j.value("mapId", 9000u); baseHeight = j.value("baseHeight", 100.0f); // Sanitize edited values — baseHeight propagates into terrain mesh