Code:
Index: src/ascent-world/GameObject.cpp
===================================================================
--- src/ascent-world/GameObject.cpp (revisione 425)
+++ src/ascent-world/GameObject.cpp (copia locale)
@@ -525,7 +525,7 @@
m_spawn = spawn;
- SetRotation(spawn->o);
+ SetRotation(spawn->facing);
SetUInt32Value(GAMEOBJECT_FLAGS,spawn->flags);
// SetUInt32Value(GAMEOBJECT_LEVEL,spawn->level);
SetByte(GAMEOBJECT_BYTES_1, 0,spawn->state);
@@ -845,14 +845,22 @@
// Convert from radians to blizz rotation system
void GameObject::SetRotation(float rad)
{
+ float f_rot1;
+
float deg = rad * (180.f / M_PI);
if (deg > 180.f)
{
- rad = (1.f - sinf(rad/2.f)) / 8.f + 1.125f;
+ f_rot1 = (1.f - sinf(rad/2.f));
}
else
{
- rad = sinf(rad/2.f) / 8.f + 1.f;
+ f_rot1 = sinf(rad/2.f);
}
- SetFloatValue(GAMEOBJECT_ROTATION, rad);
+
+ int64 rotation = 0;
+
+ int64 i_rot1 = f_rot1 / atan(pow(2.0f, -20.0f));
+ rotation |= (i_rot1 << 43 >> 43) & 0x00000000001FFFFF;
+
+ SetUInt64Value(GAMEOBJECT_ROTATION, rotation);
}
Apparently, this fix will bug .go spawn (in the way that when you spawn objects they will be rotated 180 degrees initially). Kitto and Chameleon are working on a fix.