mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
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:
parent
2119546a7a
commit
826d218226
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue