Core/Movement: Fixed SMSG_MOVE_KNOCK_BACK structure.

This commit is contained in:
Drake Fish committed 2012-01-23 20:46:19 -05:00
1 parent af12ae1fa3
commit b56d9c5e96
1 file changed
+53 -14
+53 -14
View File
@@ -16970,13 +16970,33 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
float vcos, vsin;
GetSinCos(x, y, vsin, vcos);
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
data.append(GetPackGUID());
data << uint32(0); // counter
data << float(vcos); // x direction
data << float(vsin); // y direction
data << float(speedXY); // Horizontal speed
data << float(-speedZ); // Z Movement speed (vertical)
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4));
uint64 guid = GetGUID();
uint8* bytes = (uint8*)&guid;
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[2]);
data.WriteByteMask(bytes[6]);
data.WriteByteMask(bytes[3]);
data.WriteByteMask(bytes[1]);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[7]);
data.WriteByteSeq(bytes[0]);
data << float(speedXY);
data << uint32(0);
data << float(-speedZ);
data.WriteByteSeq(bytes[6]);
data << float(vcos);
data << float(vsin);
data.WriteByteSeq(bytes[3]);
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[2]);
data.WriteByteSeq(bytes[4]);
data.WriteByteSeq(bytes[7]);
data.WriteByteSeq(bytes[5]);
data.WriteByteSeq(bytes[5]);
player->GetSession()->SendPacket(&data);
}
@@ -17290,13 +17310,32 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward)
float vcos = cos(angle+GetOrientation());
float vsin = sin(angle+GetOrientation());
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
data.append(GetPackGUID());
data << uint32(0); // Sequence
data << float(vcos); // x direction
data << float(vsin); // y direction
data << float(speedXY); // Horizontal speed
data << float(-speedZ); // Z Movement speed (vertical)
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4));
uint64 guid = GetGUID();
uint8* bytes = (uint8*)&guid;
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[2]);
data.WriteByteMask(bytes[6]);
data.WriteByteMask(bytes[3]);
data.WriteByteMask(bytes[1]);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[7]);
data.WriteByteSeq(bytes[0]);
data << float(speedXY);
data << uint32(0);
data << float(-speedZ);
data.WriteByteSeq(bytes[6]);
data << float(vcos);
data << float(vsin);
data.WriteByteSeq(bytes[3]);
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[2]);
data.WriteByteSeq(bytes[4]);
data.WriteByteSeq(bytes[7]);
data.WriteByteSeq(bytes[5]);
ToPlayer()->GetSession()->SendPacket(&data);
}