diff --git a/tools/editor/npc_spawner.cpp b/tools/editor/npc_spawner.cpp index a6573415..83445546 100644 --- a/tools/editor/npc_spawner.cpp +++ b/tools/editor/npc_spawner.cpp @@ -190,7 +190,17 @@ bool NpcSpawner::loadFromFile(const std::string& path) { if (pt.is_array() && pt.size() >= 4) { PatrolPoint pp; pp.position = glm::vec3(pt[0].get(), pt[1].get(), pt[2].get()); + // Skip waypoints with NaN/inf — would produce a path + // that warps the creature to garbage coords. + if (!std::isfinite(pp.position.x) || !std::isfinite(pp.position.y) || + !std::isfinite(pp.position.z)) + continue; pp.waitTimeMs = pt[3].get(); + // Cap wait time at 10 minutes to keep AzerothCore + // happy and prevent obvious data-entry typos that + // would produce a creature that effectively never + // moves (e.g. 24h = 86400000). + if (pp.waitTimeMs > 600000) pp.waitTimeMs = 600000; s.patrolPath.push_back(pp); } }