mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 09:33:51 +00:00
fix(npc): truncate over-long NPC name/modelPath at SQL limits
creature_template.name is varchar(100) in AzerothCore. Edited creature JSON could carry longer names that would either fail the INSERT or silently truncate. Cap name at 100 and modelPath at 1024 on load.
This commit is contained in:
parent
280fe1e6e8
commit
2119546a7a
1 changed files with 4 additions and 0 deletions
|
|
@ -149,6 +149,10 @@ bool NpcSpawner::loadFromFile(const std::string& path) {
|
|||
CreatureSpawn s;
|
||||
s.name = js.value("name", "");
|
||||
s.modelPath = js.value("model", "");
|
||||
// creature_template.name is varchar(100); modelPath is internal
|
||||
// but capped to keep export sane. Trim instead of dropping.
|
||||
if (s.name.size() > 100) s.name.resize(100);
|
||||
if (s.modelPath.size() > 1024) s.modelPath.resize(1024);
|
||||
s.displayId = js.value("displayId", 0u);
|
||||
s.orientation = js.value("orientation", 0.0f);
|
||||
// Normalise orientation to [0, 360) for consistent gizmo behaviour.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue