From 70366dc5f675de79c28c9e8501550d1fcb93b900 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 04:46:57 -0700 Subject: [PATCH] fix(sql): wander_distance is 0 for non-Wander NPCs Stationary and Patrol creatures should have wander_distance=0; only Wander behaviour uses it. Previously the editor's wanderRadius template default of 10.0 was being written for every spawn, making stationary guards drift around in-game. --- tools/editor/sql_exporter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/editor/sql_exporter.cpp b/tools/editor/sql_exporter.cpp index 3eaa78ec..ba898532 100644 --- a/tools/editor/sql_exporter.cpp +++ b/tools/editor/sql_exporter.cpp @@ -116,7 +116,9 @@ bool SQLExporter::exportCreatures(const std::vector& spawns, << wowX << ", " << wowY << ", " << wowZ << ", " << orientRad << ", " << (s.respawnTimeMs / 1000) << ", " - << s.wanderRadius << ", " + // wander_distance only meaningful for Wander behaviour; Patrol uses + // waypoint_data and Stationary doesn't move at all. + << (s.behavior == CreatureBehavior::Wander ? s.wanderRadius : 0.0f) << ", " << static_cast(movementType) << ") ON DUPLICATE KEY UPDATE `position_x`=" << wowX << ";\n"; }