From 0736b27ec777ecd9c9ceef8c9777ba118d19c4f7 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 09:52:16 -0700 Subject: [PATCH] fix(sql): downgrade Patrol behavior to stationary when path is empty A creature with behavior=Patrol but an empty patrolPath would emit movement_type=2 (waypoint) without any waypoint_data rows. AzerothCore would log 'creature X has no waypoints' on every spawn and the NPC would behave erratically. Fall back to stationary so the spawn appears cleanly; user can fix the missing path after. --- tools/editor/sql_exporter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/editor/sql_exporter.cpp b/tools/editor/sql_exporter.cpp index 3788c909..582c7eea 100644 --- a/tools/editor/sql_exporter.cpp +++ b/tools/editor/sql_exporter.cpp @@ -113,9 +113,13 @@ bool SQLExporter::exportCreatures(const std::vector& spawns, uint32_t entry = startEntry + static_cast(i); uint32_t guid = startEntry + static_cast(i); + // movementType: 0=stationary, 1=wander, 2=waypoint (patrol). + // Patrol with no waypoints would log an error in AzerothCore at + // spawn — fall back to stationary so the spawn still appears. uint8_t movementType = 0; if (s.behavior == CreatureBehavior::Wander) movementType = 1; - if (s.behavior == CreatureBehavior::Patrol) movementType = 2; + if (s.behavior == CreatureBehavior::Patrol && !s.patrolPath.empty()) + movementType = 2; // Editor stores positions in render coords; AzerothCore expects WoW // canonical (X=north, Y=west). renderToCanonical handles the swap.