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.
This commit is contained in:
Kelsi 2026-05-06 07:02:09 -07:00
parent 2119546a7a
commit 826d218226

View file

@ -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