fix(sql): convert NPC orientation from degrees to radians for AzerothCore

The editor's orientation field is stored in degrees (matches the UI slider
and the M2 renderer's glm::radians() call), but AzerothCore's creature.
orientation column expects radians. Without conversion every exported NPC
faces the wrong direction in-game (off by 57x).
This commit is contained in:
Kelsi 2026-05-06 01:28:46 -07:00
parent 09f573c6ee
commit ec50c41044

View file

@ -88,12 +88,14 @@ bool SQLExporter::exportCreatures(const std::vector<CreatureSpawn>& spawns,
if (s.behavior == CreatureBehavior::Wander) movementType = 1;
if (s.behavior == CreatureBehavior::Patrol) movementType = 2;
// AzerothCore expects orientation in radians; editor stores degrees.
const float orientRad = s.orientation * 3.14159265358979323846f / 180.0f;
f << "INSERT INTO `creature` "
<< "(`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, "
<< "`orientation`, `spawntimesecs`, `wander_distance`, `MovementType`) VALUES ("
<< guid << ", " << entry << ", " << mapId << ", "
<< s.position.x << ", " << s.position.y << ", " << s.position.z << ", "
<< s.orientation << ", "
<< orientRad << ", "
<< (s.respawnTimeMs / 1000) << ", "
<< s.wanderRadius << ", "
<< static_cast<int>(movementType)