mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
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:
parent
09f573c6ee
commit
ec50c41044
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue