Created
March 9, 2011 04:02
-
-
Save vermie/861674 to your computer and use it in GitHub Desktop.
mmaps_one patch ONE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp | |
index 8a45c6b..138ce3c 100644 | |
--- a/src/game/Unit.cpp | |
+++ b/src/game/Unit.cpp | |
@@ -11942,10 +11942,9 @@ void Unit::SendMonsterMoveByPath(Path<Elem,Node> const& path, uint32 start, uint | |
return; | |
} | |
- uint32 packSize = (flags & SplineFlags(SPLINEFLAG_FLYING | SPLINEFLAG_CATMULLROM)) ? pathSize*4*3 : 4*3 + (pathSize-1)*4; | |
- WorldPacket data( SMSG_MONSTER_MOVE, (GetPackGUID().size()+1+4+4+4+4+1+4+4+4+packSize) ); | |
+ uint32 packSize = (flags & SPLINEFLAG_FLYING) ? pathSize*4*3 : 4*3 + (pathSize-1)*4; | |
+ WorldPacket data( SMSG_MONSTER_MOVE, (GetPackGUID().size()+4+4+4+4+1+4+4+4+packSize) ); | |
data << GetPackGUID(); | |
- data << uint8(0); | |
data << GetPositionX(); | |
data << GetPositionY(); | |
data << GetPositionZ(); | |
@@ -11955,7 +11954,7 @@ void Unit::SendMonsterMoveByPath(Path<Elem,Node> const& path, uint32 start, uint | |
data << uint32(traveltime); | |
data << uint32(pathSize); | |
- if (flags & SplineFlags(SPLINEFLAG_FLYING | SPLINEFLAG_CATMULLROM)) | |
+ if (flags & SPLINEFLAG_FLYING) | |
{ | |
// sending a taxi flight path | |
for (uint32 i = start; i < end; ++i) | |
diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h | |
index a93346f..734f300 100644 | |
--- a/src/shared/ByteBuffer.h | |
+++ b/src/shared/ByteBuffer.h | |
@@ -372,6 +372,16 @@ class ByteBuffer | |
append(buffer.contents(), buffer.wpos()); | |
} | |
+ // can be used in SMSG_MONSTER_MOVE opcode | |
+ void appendPackXYZ(float x, float y, float z) | |
+ { | |
+ uint32 packed = 0; | |
+ packed |= ((int)(x / 0.25f) & 0x7FF); | |
+ packed |= ((int)(y / 0.25f) & 0x7FF) << 11; | |
+ packed |= ((int)(z / 0.25f) & 0x3FF) << 22; | |
+ *this << packed; | |
+ } | |
+ | |
void appendPackGUID(uint64 guid) | |
{ | |
uint8 packGUID[8+1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment