Merge branch '4.3.4' of github.com:TrinityCore/TrinityCore into 4.3.4
This commit is contained in:
@@ -306,6 +306,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
data->WriteBit(flags & UPDATEFLAG_UNK5);
|
||||
data->WriteBit(0);
|
||||
data->WriteBit(flags & UPDATEFLAG_TRANSPORT);
|
||||
bool fullSpline = false;
|
||||
|
||||
if (flags & UPDATEFLAG_LIVING)
|
||||
{
|
||||
@@ -349,10 +350,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
|
||||
data->WriteBit(guid[4]);
|
||||
if (self->IsSplineEnabled())
|
||||
{
|
||||
data->WriteBit(1); // Has extended spline data
|
||||
Movement::PacketBuilder::WriteCreateBits(*self->movespline, *data);
|
||||
}
|
||||
Movement::PacketBuilder::WriteCreateBits(*self->movespline, *data, fullSpline);
|
||||
|
||||
data->WriteBit(guid[6]);
|
||||
if (movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_TURNING)
|
||||
@@ -435,7 +433,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
*data << float(self->m_movementInfo.splineElevation);
|
||||
|
||||
if (self->IsSplineEnabled())
|
||||
Movement::PacketBuilder::WriteCreateData(*self->movespline, *data);
|
||||
Movement::PacketBuilder::WriteCreateData(*self->movespline, *data, fullSpline);
|
||||
|
||||
*data << float(self->GetPositionZMinusOffset());
|
||||
data->WriteByteSeq(guid[5]);
|
||||
|
||||
@@ -18252,5 +18252,5 @@ void Unit::SendMovementCanFlyChange()
|
||||
|
||||
bool Unit::IsSplineEnabled() const
|
||||
{
|
||||
return !movespline->Finalized();
|
||||
return movespline->Initialized();
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ bool MoveSplineInitArgs::Validate() const
|
||||
// each vertex offset packed into 11 bytes
|
||||
bool MoveSplineInitArgs::_checkPathBounds() const
|
||||
{
|
||||
if (!(flags & MoveSplineFlag::Mask_CatmullRom) && path.size() > 2)
|
||||
if (!(flags & MoveSplineFlag::Catmullrom) && path.size() > 2)
|
||||
{
|
||||
enum{
|
||||
MAX_OFFSET = (1 << 11) / 2,
|
||||
|
||||
@@ -71,10 +71,8 @@ namespace Movement
|
||||
Mask_Animations = 0xF,
|
||||
// flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably
|
||||
Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done,
|
||||
// CatmullRom interpolation mode used
|
||||
Mask_CatmullRom = Catmullrom | Flying,
|
||||
// Unused, not suported flags
|
||||
Mask_Unused = No_Spline|Enter_Cycle|Frozen|UncompressedPath|Unknown1|Unknown2|Unknown3|Unknown4|Unknown5|Unknown6|Unknown7|Unknown8|Unknown9,
|
||||
Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown1|Unknown2|Unknown3|Unknown4|Unknown5|Unknown6|Unknown7|Unknown8|Unknown9,
|
||||
};
|
||||
|
||||
inline uint32& raw() { return (uint32&)*this; }
|
||||
@@ -86,7 +84,7 @@ namespace Movement
|
||||
|
||||
// Constant interface
|
||||
|
||||
bool isSmooth() const { return raw() & Mask_CatmullRom; }
|
||||
bool isSmooth() const { return raw() & Catmullrom; }
|
||||
bool isLinear() const { return !isSmooth(); }
|
||||
bool isFacing() const { return raw() & Mask_Final_Facing; }
|
||||
|
||||
@@ -99,14 +97,14 @@ namespace Movement
|
||||
|
||||
// Not constant interface
|
||||
|
||||
void operator &= (uint32 f) { raw() &= f;}
|
||||
void operator |= (uint32 f) { raw() |= f;}
|
||||
void operator &= (uint32 f) { raw() &= f; }
|
||||
void operator |= (uint32 f) { raw() |= f; }
|
||||
|
||||
void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic)) | Animation | anim; }
|
||||
void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic)) | Animation | (anim & Mask_Animations); }
|
||||
void EnableParabolic() { raw() = (raw() & ~(Mask_Animations | Falling | Animation)) | Parabolic; }
|
||||
void EnableFalling() { raw() = (raw() & ~(Mask_Animations | Parabolic | Animation)) | Falling; }
|
||||
void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; }
|
||||
void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; }
|
||||
void EnableFlying() { raw() = Flying; }
|
||||
void EnableCatmullRom() { raw() = Catmullrom | UncompressedPath; }
|
||||
void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point; }
|
||||
void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle; }
|
||||
void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target; }
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace Movement
|
||||
args.TransformForTransport = unit.GetTransGUID();
|
||||
// mix existing state into new
|
||||
args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_DISABLE_GRAVITY));
|
||||
args.flags.flying = unit.m_movementInfo.HasMovementFlag(MovementFlags(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY));
|
||||
}
|
||||
|
||||
void MoveSplineInit::SetFacing(const Unit * target)
|
||||
|
||||
@@ -140,8 +140,12 @@ namespace Movement
|
||||
WriteLinearPath(spline, data);
|
||||
}
|
||||
|
||||
void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data)
|
||||
void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data, bool& fullData)
|
||||
{
|
||||
fullData = data.WriteBit(!moveSpline.Finalized());
|
||||
if (!fullData)
|
||||
return;
|
||||
|
||||
data.WriteBits(uint8(moveSpline.spline.mode()), 2);
|
||||
data.WriteBit(moveSpline.splineflags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation));
|
||||
data.WriteBits(moveSpline.getPath().size(), 22);
|
||||
@@ -176,48 +180,51 @@ namespace Movement
|
||||
data.WriteBits(moveSpline.splineflags.raw(), 25);
|
||||
}
|
||||
|
||||
void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data)
|
||||
void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data, bool fullData)
|
||||
{
|
||||
MoveSplineFlag splineFlags = moveSpline.splineflags;
|
||||
|
||||
if ((splineFlags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration())
|
||||
data << moveSpline.vertical_acceleration; // added in 3.1
|
||||
|
||||
data << moveSpline.timePassed();
|
||||
|
||||
if (splineFlags.final_angle)
|
||||
data << moveSpline.facing.angle;
|
||||
else if (splineFlags.final_target)
|
||||
if (fullData)
|
||||
{
|
||||
ObjectGuid facingGuid = moveSpline.facing.target;
|
||||
data.WriteByteSeq(facingGuid[5]);
|
||||
data.WriteByteSeq(facingGuid[3]);
|
||||
data.WriteByteSeq(facingGuid[7]);
|
||||
data.WriteByteSeq(facingGuid[1]);
|
||||
data.WriteByteSeq(facingGuid[6]);
|
||||
data.WriteByteSeq(facingGuid[4]);
|
||||
data.WriteByteSeq(facingGuid[2]);
|
||||
data.WriteByteSeq(facingGuid[0]);
|
||||
MoveSplineFlag splineFlags = moveSpline.splineflags;
|
||||
|
||||
if ((splineFlags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration())
|
||||
data << moveSpline.vertical_acceleration; // added in 3.1
|
||||
|
||||
data << moveSpline.timePassed();
|
||||
|
||||
if (splineFlags.final_angle)
|
||||
data << moveSpline.facing.angle;
|
||||
else if (splineFlags.final_target)
|
||||
{
|
||||
ObjectGuid facingGuid = moveSpline.facing.target;
|
||||
data.WriteByteSeq(facingGuid[5]);
|
||||
data.WriteByteSeq(facingGuid[3]);
|
||||
data.WriteByteSeq(facingGuid[7]);
|
||||
data.WriteByteSeq(facingGuid[1]);
|
||||
data.WriteByteSeq(facingGuid[6]);
|
||||
data.WriteByteSeq(facingGuid[4]);
|
||||
data.WriteByteSeq(facingGuid[2]);
|
||||
data.WriteByteSeq(facingGuid[0]);
|
||||
}
|
||||
|
||||
uint32 nodes = moveSpline.getPath().size();
|
||||
for (uint32 i = 0; i < nodes; ++i)
|
||||
{
|
||||
data << float(moveSpline.getPath()[i].z);
|
||||
data << float(moveSpline.getPath()[i].x);
|
||||
data << float(moveSpline.getPath()[i].y);
|
||||
}
|
||||
|
||||
if (splineFlags.final_point)
|
||||
data << moveSpline.facing.f.x << moveSpline.facing.f.z << moveSpline.facing.f.y;
|
||||
|
||||
data << float(1.f); // splineInfo.duration_mod_next; added in 3.1
|
||||
data << moveSpline.Duration();
|
||||
if (splineFlags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation))
|
||||
data << moveSpline.effect_start_time; // added in 3.1
|
||||
|
||||
data << float(1.f); // splineInfo.duration_mod; added in 3.1
|
||||
}
|
||||
|
||||
uint32 nodes = moveSpline.getPath().size();
|
||||
for (uint32 i = 0; i < nodes; ++i)
|
||||
{
|
||||
data << float(moveSpline.getPath()[i].z);
|
||||
data << float(moveSpline.getPath()[i].x);
|
||||
data << float(moveSpline.getPath()[i].y);
|
||||
}
|
||||
|
||||
if (splineFlags.final_point)
|
||||
data << moveSpline.facing.f.x << moveSpline.facing.f.z << moveSpline.facing.f.y;
|
||||
|
||||
data << float(1.f); // splineInfo.duration_mod_next; added in 3.1
|
||||
data << moveSpline.Duration();
|
||||
if (splineFlags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation))
|
||||
data << moveSpline.effect_start_time; // added in 3.1
|
||||
|
||||
data << float(1.f); // splineInfo.duration_mod; added in 3.1
|
||||
|
||||
if (!moveSpline.isCyclic())
|
||||
{
|
||||
Vector3 dest = moveSpline.FinalDestination();
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace Movement
|
||||
public:
|
||||
|
||||
static void WriteMonsterMove(const MoveSpline& mov, WorldPacket& data);
|
||||
static void WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data);
|
||||
static void WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data);
|
||||
static void WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data, bool& fullData);
|
||||
static void WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data, bool fullData);
|
||||
};
|
||||
}
|
||||
#endif // TRINITYSERVER_PACKET_BUILDER_H
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Movement
|
||||
|
||||
#define STR(x) #x
|
||||
|
||||
const char * g_MovementFlag_names[]=
|
||||
const char* g_MovementFlag_names[]=
|
||||
{
|
||||
STR(Forward ),// 0x00000001,
|
||||
STR(Backward ),// 0x00000002,
|
||||
@@ -112,29 +112,29 @@ namespace Movement
|
||||
STR(Pitch_Down ),// 0x00000080,
|
||||
|
||||
STR(Walk ),// 0x00000100, // Walking
|
||||
STR(Ontransport ),// 0x00000200,
|
||||
STR(Levitation ),// 0x00000400,
|
||||
STR(Root ),// 0x00000800,
|
||||
STR(Falling ),// 0x00001000,
|
||||
STR(Fallingfar ),// 0x00002000,
|
||||
STR(Pendingstop ),// 0x00004000,
|
||||
STR(PendingSTRafestop ),// 0x00008000,
|
||||
STR(Pendingforward ),// 0x00010000,
|
||||
STR(Pendingbackward ),// 0x00020000,
|
||||
STR(PendingSTRafeleft ),// 0x00040000,
|
||||
STR(PendingSTRaferight ),// 0x00080000,
|
||||
STR(Pendingroot ),// 0x00100000,
|
||||
STR(Swimming ),// 0x00200000, // Appears With Fly Flag Also
|
||||
STR(Ascending ),// 0x00400000, // Swim Up Also
|
||||
STR(Descending ),// 0x00800000, // Swim Down Also
|
||||
STR(Can_Fly ),// 0x01000000, // Can Fly In 3.3?
|
||||
STR(Flying ),// 0x02000000, // Actual Flying Mode
|
||||
STR(Spline_Elevation ),// 0x04000000, // Used For Flight Paths
|
||||
STR(Spline_Enabled ),// 0x08000000, // Used For Flight Paths
|
||||
STR(Waterwalking ),// 0x10000000, // Prevent Unit From Falling Through Water
|
||||
STR(Safe_Fall ),// 0x20000000, // Active Rogue Safe Fall Spell (Passive)
|
||||
STR(Hover ),// 0x40000000
|
||||
STR(Unknown13 ),// 0x80000000
|
||||
STR(Levitation ),// 0x00000200,
|
||||
STR(Root ),// 0x00000400,
|
||||
STR(Falling ),// 0x00000800,
|
||||
STR(Fallingfar ),// 0x00001000,
|
||||
STR(Pendingstop ),// 0x00002000,
|
||||
STR(PendingSTRafestop ),// 0x00004000,
|
||||
STR(Pendingforward ),// 0x00008000,
|
||||
STR(Pendingbackward ),// 0x00010000,
|
||||
STR(PendingSTRafeleft ),// 0x00020000,
|
||||
STR(PendingSTRaferight ),// 0x00040000,
|
||||
STR(Pendingroot ),// 0x00080000,
|
||||
STR(Swimming ),// 0x00100000, // Appears With Fly Flag Also
|
||||
STR(Ascending ),// 0x00200000, // Swim Up Also
|
||||
STR(Descending ),// 0x00400000, // Swim Down Also
|
||||
STR(Can_Fly ),// 0x00800000, // Can Fly In 3.3?
|
||||
STR(Flying ),// 0x01000000, // Actual Flying Mode
|
||||
STR(Spline_Elevation ),// 0x02000000, // Used For Flight Paths
|
||||
STR(Waterwalking ),// 0x04000000, // Prevent Unit From Falling Through Water
|
||||
STR(Safe_Fall ),// 0x08000000, // Active Rogue Safe Fall Spell (Passive)
|
||||
STR(Hover ),// 0x10000000
|
||||
STR(Local_Dirty ),// 0x20000000
|
||||
STR(None31 ),// 0x40000000
|
||||
STR(None32 ),// 0x80000000
|
||||
STR(Unk1 ),
|
||||
STR(Unk2 ),
|
||||
STR(Unk3 ),
|
||||
@@ -155,38 +155,38 @@ namespace Movement
|
||||
|
||||
const char * g_SplineFlag_names[32]=
|
||||
{
|
||||
STR(AnimBit1 ),// 0x00000001,
|
||||
STR(AnimBit2 ),// 0x00000002,
|
||||
STR(AnimBit3 ),// 0x00000004,
|
||||
STR(AnimBit4 ),// 0x00000008,
|
||||
STR(AnimBit5 ),// 0x00000010,
|
||||
STR(AnimBit6 ),// 0x00000020,
|
||||
STR(AnimBit7 ),// 0x00000040,
|
||||
STR(AnimBit8 ),// 0x00000080,
|
||||
STR(Done ),// 0x00000100,
|
||||
STR(Falling ),// 0x00000200, // Not Compartible With Trajectory Movement
|
||||
STR(No_Spline ),// 0x00000400,
|
||||
STR(Trajectory ),// 0x00000800, // Not Compartible With Fall Movement
|
||||
STR(Walkmode ),// 0x00001000,
|
||||
STR(Flying ),// 0x00002000, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation
|
||||
STR(Knockback ),// 0x00004000, // Model Orientation Fixed
|
||||
STR(Final_Point ),// 0x00008000,
|
||||
STR(Final_Target ),// 0x00010000,
|
||||
STR(Final_Angle ),// 0x00020000,
|
||||
STR(Catmullrom ),// 0x00040000, // Used Catmullrom Interpolation Mode
|
||||
STR(Cyclic ),// 0x00080000, // Movement By Cycled Spline
|
||||
STR(Enter_Cycle ),// 0x00100000, // Everytime Appears With Cyclic Flag In Monster Move Packet
|
||||
STR(Animation ),// 0x00200000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement
|
||||
STR(Unknown4 ),// 0x00400000, // Disables Movement By Path
|
||||
STR(Unknown5 ),// 0x00800000,
|
||||
STR(Unknown6 ),// 0x01000000,
|
||||
STR(Unknown7 ),// 0x02000000,
|
||||
STR(Unknown8 ),// 0x04000000,
|
||||
STR(OrientationInversed ),// 0x08000000, // Appears With Runmode Flag, Nodes ),// 1, Handles Orientation
|
||||
STR(Unknown10 ),// 0x10000000,
|
||||
STR(Unknown11 ),// 0x20000000,
|
||||
STR(Unknown12 ),// 0x40000000,
|
||||
STR(Unknown13 ),// 0x80000000,
|
||||
STR(AnimBit1 ),// 0x00000001,
|
||||
STR(AnimBit2 ),// 0x00000002,
|
||||
STR(AnimBit3 ),// 0x00000004,
|
||||
STR(AnimBit4 ),// 0x00000008,
|
||||
STR(Unknown1 ),// 0x00000010,
|
||||
STR(Done ),// 0x00000020,
|
||||
STR(Falling ),// 0x00000040, // Not Compartible With Trajectory Movement
|
||||
STR(No_Spline ),// 0x00000080,
|
||||
STR(Unknown2 ),// 0x00000100,
|
||||
STR(Flying ),// 0x00000200, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation
|
||||
STR(OrientationFixed ),// 0x00000400, // Model Orientation Fixed
|
||||
STR(Catmullrom ),// 0x00000800, // Used Catmullrom Interpolation Mode
|
||||
STR(Cyclic ),// 0x00001000, // Movement By Cycled Spline
|
||||
STR(Enter_Cycle ),// 0x00002000, // Everytime Appears With Cyclic Flag In Monster Move Packet
|
||||
STR(Frozen ),// 0x00004000,
|
||||
STR(TransportEnter ),// 0x00008000
|
||||
STR(TransportExit ),// 0x00010000
|
||||
STR(Unknown3 ),// 0x00020000,
|
||||
STR(Unknown4 ),// 0x00040000,
|
||||
STR(OrientationInversed),// 0x00080000, // Appears With Runmode Flag, Nodes ),// 1, Handles Orientation
|
||||
STR(Unknown5 ),// 0x00100000,
|
||||
STR(Walkmode ),// 0x00200000,
|
||||
STR(UncompressedPath ),// 0x00400000,
|
||||
STR(Unknown6 ),// 0x00800000,
|
||||
STR(Animation ),// 0x01000000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement
|
||||
STR(Parabolic ),// 0x02000000, // Not Compartible With Fall Movement
|
||||
STR(Final_Point ),// 0x04000000,
|
||||
STR(Final_Target ),// 0x08000000,
|
||||
STR(Final_Angle ),// 0x10000000,
|
||||
STR(Unknown7 ),// 0x20000000,
|
||||
STR(Unknown8 ),// 0x40000000,
|
||||
STR(Unknown9 ),// 0x80000000,
|
||||
};
|
||||
|
||||
template<class Flags, int N>
|
||||
@@ -202,7 +202,7 @@ namespace Movement
|
||||
std::string MoveSplineFlag::ToString() const
|
||||
{
|
||||
std::string str;
|
||||
print_flags(raw(),g_SplineFlag_names,str);
|
||||
print_flags(raw(), g_SplineFlag_names, str);
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user