diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 67 |
1 files changed, 53 insertions, 14 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5c481033273..35b337f5a15 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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); } |