From 280fe1e6e81da26506415d8fb6c8337aed192b04 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 07:01:00 -0700 Subject: [PATCH] fix(quest): truncate over-long title/desc/completion to SQL limits quest_template.LogTitle is varchar(200) in AzerothCore. Edited quest JSON could carry longer strings that would either fail the INSERT or silently truncate at the server. Cap title at 200 chars and the longer text fields at 8KB on load. --- tools/editor/quest_editor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/editor/quest_editor.cpp b/tools/editor/quest_editor.cpp index 2a84f2d8..e8066640 100644 --- a/tools/editor/quest_editor.cpp +++ b/tools/editor/quest_editor.cpp @@ -82,6 +82,13 @@ bool QuestEditor::loadFromFile(const std::string& path) { q.title = jq.value("title", "Untitled"); q.description = jq.value("description", ""); q.completionText = jq.value("completionText", ""); + // AzerothCore quest_template.LogTitle is varchar(200); the + // Description/QuestCompletionLog are text but practically capped. + // Truncate edited values so SQL writes don't get rejected by + // length constraints or bloat the export. + if (q.title.size() > 200) q.title.resize(200); + if (q.description.size() > 8192) q.description.resize(8192); + if (q.completionText.size() > 8192) q.completionText.resize(8192); q.requiredLevel = jq.value("requiredLevel", 1u); // WoW levels 1-80 (WotLK). Cap to keep AzerothCore happy and // catch obvious typos like "999".