Core/Movement: Ensured object orientation is always within 0-2pi range, this fixes movement.

This commit is contained in:
Shauren
2012-08-10 14:10:57 +02:00
parent 5e1e9bb4dd
commit 9538fb6d5a
11 changed files with 40 additions and 27 deletions
+10 -9
View File
@@ -16257,20 +16257,20 @@ void Unit::SendMoveRoot(uint32 value)
data.WriteBit(guid[4]);
data.WriteBit(guid[1]);
data.WriteBit(guid[3]);
data.WriteByteSeq(guid[1]);
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[5]);
data << uint32(value);
data.WriteByteSeq(guid[3]);
data.WriteByteSeq(guid[4]);
data.WriteByteSeq(guid[7]);
data.WriteByteSeq(guid[6]);
SendMessageToSet(&data, true);
}
@@ -16286,19 +16286,19 @@ void Unit::SendMoveUnroot(uint32 value)
data.WriteBit(guid[2]);
data.WriteBit(guid[4]);
data.WriteBit(guid[6]);
data.WriteByteSeq(guid[3]);
data.WriteByteSeq(guid[6]);
data.WriteByteSeq(guid[1]);
data << uint32(value);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[7]);
data.WriteByteSeq(guid[4]);
data.WriteByteSeq(guid[5]);
SendMessageToSet(&data, true);
}
@@ -17849,6 +17849,7 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel
return false;
}
orientation = MapManager::NormalizeOrientation(orientation);
bool turn = (GetOrientation() != orientation);
bool relocated = (teleport || GetPositionX() != x || GetPositionY() != y || GetPositionZ() != z);