Core/Units: Removed deprecated BuildMovementPacket method and updated MovementFlags2 enum

This commit is contained in:
Shauren
2013-04-01 14:45:47 +02:00
parent f63fd0bc18
commit b431a499a7
7 changed files with 177 additions and 202 deletions
+41 -22
View File
@@ -357,6 +357,8 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
uint32 movementFlags = 0;
uint16 movementFlagsExtra = 0;
bool hasTransportTime2 = false;
bool hasTransportTime3 = false;
bool hasFallDirection = false;
bool hasFallData = false;
bool hasPitch = false;
@@ -386,15 +388,28 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
self = ToUnit();
movementFlags = self->m_movementInfo.GetMovementFlags();
movementFlagsExtra = self->m_movementInfo.GetExtraMovementFlags();
hasPitch = ((movementFlags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) ||
(movementFlagsExtra & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING));
hasSpline = self->IsSplineEnabled();
hasSplineElevation = movementFlags & MOVEMENTFLAG_SPLINE_ELEVATION;
hasFallData = movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_TURNING;
hasFallDirection = movementFlags & MOVEMENTFLAG_FALLING;
if (GetTypeId() == TYPEID_UNIT)
if (GetTypeId() == TYPEID_PLAYER)
{
hasTransportTime2 = self->m_movementInfo.bits.hasTransportTime2;
hasTransportTime3 = self->m_movementInfo.bits.hasTransportTime3;
hasPitch = self->m_movementInfo.bits.hasPitch;
hasFallData = self->m_movementInfo.bits.hasFallData;
hasFallDirection = self->m_movementInfo.bits.hasFallDirection;
hasSplineElevation = self->m_movementInfo.bits.hasSplineElevation;
}
else
{
hasTransportTime2 = self->HasExtraUnitMovementFlag(MOVEMENTFLAG2_INTERPOLATED_MOVEMENT);
hasPitch = ((movementFlags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) ||
(movementFlagsExtra & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING));
hasFallDirection = movementFlags & MOVEMENTFLAG_FALLING;
hasFallData = hasFallDirection; // FallDirection implies that FallData is set as well
hasSplineElevation = movementFlags & MOVEMENTFLAG_SPLINE_ELEVATION;
movementFlags &= MOVEMENTFLAG_MASK_CREATURE_ALLOWED;
}
data->WriteBit(!movementFlags);
data->WriteBit(G3D::fuzzyEq(self->GetOrientation(), 0.0f)); // Has Orientation
@@ -524,16 +539,16 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
data->WriteByteSeq(transGuid[7]);
*data << uint32(self->GetTransTime());
*data << float(self->GetTransOffsetO());
//if (hasTransportTime2)
// *data << uint32(0);
if (hasTransportTime2)
*data << uint32(self->m_movementInfo.t_time2);
*data << float(self->GetTransOffsetY());
*data << float(self->GetTransOffsetX());
data->WriteByteSeq(transGuid[3]);
*data << float(self->GetTransOffsetZ());
data->WriteByteSeq(transGuid[0]);
//if (hasTransportTime3)
// *data << uint32(0);
if (hasTransportTime3)
*data << uint32(self->m_movementInfo.t_time3);
*data << int8(self->GetTransSeat());
data->WriteByteSeq(transGuid[1]);
@@ -582,8 +597,8 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
data->WriteBit(transGuid[0]);
data->WriteBit(transGuid[5]);
//if (hasTransportTime3)
// *data << uint32(0);
if (hasTransportTime3)
*data << uint32(self->m_movementInfo.t_time3);
data->WriteBit(transGuid[3]);
*data << float(self->GetTransOffsetX());
@@ -597,8 +612,8 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
*data << float(self->GetTransOffsetZ());
*data << int8(self->GetTransSeat());
*data << float(self->GetTransOffsetO());
//if (hasTransportTime2)
// *data << uint32(0);
if (hasTransportTime2)
*data << uint32(self->m_movementInfo.t_time2);
}
if (flags & UPDATEFLAG_ROTATION)
@@ -1521,9 +1536,9 @@ void MovementInfo::OutDebug()
{
sLog->outInfo(LOG_FILTER_GENERAL, "MOVEMENT INFO");
sLog->outInfo(LOG_FILTER_GENERAL, "guid " UI64FMTD, guid);
sLog->outInfo(LOG_FILTER_GENERAL, "flags %u", flags);
sLog->outInfo(LOG_FILTER_GENERAL, "flags2 %u", flags2);
sLog->outInfo(LOG_FILTER_GENERAL, "time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
sLog->outInfo(LOG_FILTER_GENERAL, "flags %s (%u)", Movement::MovementFlags_ToString(flags).c_str(), flags);
sLog->outInfo(LOG_FILTER_GENERAL, "flags2 %s (%u)", Movement::MovementFlagsExtra_ToString(flags2).c_str(), flags2);
sLog->outInfo(LOG_FILTER_GENERAL, "time %u current time %u", time, getMSTime());
sLog->outInfo(LOG_FILTER_GENERAL, "position: `%s`", pos.ToString().c_str());
if (t_guid)
{
@@ -1534,14 +1549,19 @@ void MovementInfo::OutDebug()
sLog->outInfo(LOG_FILTER_GENERAL, "time: %u", t_time);
if (flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT)
sLog->outInfo(LOG_FILTER_GENERAL, "time2: %u", t_time2);
if (bits.hasTransportTime3)
sLog->outInfo(LOG_FILTER_GENERAL, "time3: %u", t_time3);
}
if ((flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING))
sLog->outInfo(LOG_FILTER_GENERAL, "pitch: %f", pitch);
sLog->outInfo(LOG_FILTER_GENERAL, "fallTime: %u", fallTime);
if (flags & MOVEMENTFLAG_FALLING)
sLog->outInfo(LOG_FILTER_GENERAL, "j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed);
if (flags & MOVEMENTFLAG_FALLING || bits.hasFallData)
{
sLog->outInfo(LOG_FILTER_GENERAL, "fallTime: %u j_zspeed: %f", fallTime, j_zspeed);
if (flags & MOVEMENTFLAG_FALLING)
sLog->outInfo(LOG_FILTER_GENERAL, "j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_sinAngle, j_cosAngle, j_xyspeed);
}
if (flags & MOVEMENTFLAG_SPLINE_ELEVATION)
sLog->outInfo(LOG_FILTER_GENERAL, "splineElevation: %f", splineElevation);
@@ -2522,8 +2542,7 @@ void WorldObject::BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const*
void Unit::BuildHeartBeatMsg(WorldPacket* data) const
{
data->Initialize(MSG_MOVE_HEARTBEAT, 32);
data->append(GetPackGUID());
BuildMovementPacket(data);
WriteMovementInfo(*data);
}
void WorldObject::SendMessageToSet(WorldPacket* data, bool self)
+19 -4
View File
@@ -480,11 +480,26 @@ struct MovementInfo
// spline
float splineElevation;
// bit markers
struct MovementElementMarkers
{
bool hasTransportTime2;
bool hasTransportTime3;
bool hasPitch;
bool hasFallData;
bool hasFallDirection;
bool hasSplineElevation;
} bits;
MovementInfo() :
guid(), flags(), flags2(), pos(), time(), t_guid(), t_pos(),
t_seat(-1), t_time(), t_time2(), pitch(), fallTime(),
j_zspeed(), j_sinAngle(), j_cosAngle(), j_xyspeed()
{ }
guid(0), flags(0), flags2(0), time(0), t_guid(0),
t_seat(-1), t_time(0), t_time2(0), t_time3(0), pitch(0.0f), fallTime(0),
j_zspeed(0.0f), j_sinAngle(0.0f), j_cosAngle(0.0f), j_xyspeed(0.0f)
{
pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
memset(&bits, 0, sizeof(bits));
}
uint32 GetMovementFlags() const { return flags; }
void SetMovementFlags(uint32 flag) { flags = flag; }
+58 -132
View File
@@ -16421,92 +16421,6 @@ void Unit::_ExitVehicle(Position const* exitPosition)
}
}
void Unit::BuildMovementPacket(ByteBuffer *data) const
{
*data << uint32(GetUnitMovementFlags()); // movement flags
*data << uint16(GetExtraUnitMovementFlags()); // 2.3.0
*data << uint32(getMSTime()); // time / counter
*data << GetPositionX();
*data << GetPositionY();
*data << GetPositionZMinusOffset();
*data << GetOrientation();
bool onTransport = m_movementInfo.t_guid != 0;
bool hasInterpolatedMovement = m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT;
bool time3 = false;
bool swimming = ((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING))
|| (m_movementInfo.flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING));
bool interPolatedTurning = m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_TURNING;
bool jumping = GetUnitMovementFlags() & MOVEMENTFLAG_FALLING;
bool splineElevation = GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE_ELEVATION;
bool splineData = false;
data->WriteBits(GetUnitMovementFlags(), 30);
data->WriteBits(m_movementInfo.flags2, 12);
data->WriteBit(onTransport);
if (onTransport)
{
data->WriteBit(hasInterpolatedMovement);
data->WriteBit(time3);
}
data->WriteBit(swimming);
data->WriteBit(interPolatedTurning);
if (interPolatedTurning)
data->WriteBit(jumping);
data->WriteBit(splineElevation);
data->WriteBit(splineData);
data->FlushBits(); // reset bit stream
*data << uint64(GetGUID());
*data << uint32(getMSTime());
*data << float(GetPositionX());
*data << float(GetPositionY());
*data << float(GetPositionZ());
*data << float(GetOrientation());
if (onTransport)
{
if (m_vehicle)
*data << uint64(m_vehicle->GetBase()->GetGUID());
else if (GetTransport())
*data << uint64(GetTransport()->GetGUID());
else // probably should never happen
*data << (uint64)0;
*data << float (GetTransOffsetX());
*data << float (GetTransOffsetY());
*data << float (GetTransOffsetZ());
*data << float (GetTransOffsetO());
*data << uint8 (GetTransSeat());
*data << uint32(GetTransTime());
if (hasInterpolatedMovement)
*data << int32(0); // Transport Time 2
if (time3)
*data << int32(0); // Transport Time 3
}
if (swimming)
*data << (float)m_movementInfo.pitch;
if (interPolatedTurning)
{
*data << (uint32)m_movementInfo.fallTime;
*data << (float)m_movementInfo.j_zspeed;
if (jumping)
{
*data << (float)m_movementInfo.j_sinAngle;
*data << (float)m_movementInfo.j_cosAngle;
*data << (float)m_movementInfo.j_xyspeed;
}
}
if (splineElevation)
*data << (float)m_movementInfo.splineElevation;
}
void Unit::SetCanFly(bool apply)
{
if (apply)
@@ -16539,13 +16453,6 @@ void Unit::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
bool hasTimestamp = false;
bool hasOrientation = false;
bool hasTransportData = false;
bool hasTransportTime2 = false;
bool hasTransportTime3 = false;
bool hasPitch = false;
bool hasFallData = false;
bool hasFallDirection = false;
bool hasSplineElevation = false;
bool hasSpline = false;
MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode());
if (sequence == NULL)
@@ -16610,27 +16517,27 @@ void Unit::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
break;
case MSEHasTransportTime2:
if (hasTransportData)
hasTransportTime2 = data.ReadBit();
mi->bits.hasTransportTime2 = data.ReadBit();
break;
case MSEHasTransportTime3:
if (hasTransportData)
hasTransportTime3 = data.ReadBit();
mi->bits.hasTransportTime3 = data.ReadBit();
break;
case MSEHasPitch:
hasPitch = !data.ReadBit();
mi->bits.hasPitch = !data.ReadBit();
break;
case MSEHasFallData:
hasFallData = data.ReadBit();
mi->bits.hasFallData = data.ReadBit();
break;
case MSEHasFallDirection:
if (hasFallData)
hasFallDirection = data.ReadBit();
if (mi->bits.hasFallData)
mi->bits.hasFallDirection = data.ReadBit();
break;
case MSEHasSplineElevation:
hasSplineElevation = !data.ReadBit();
mi->bits.hasSplineElevation = !data.ReadBit();
break;
case MSEHasSpline:
hasSpline = data.ReadBit();
data.ReadBit();
break;
case MSEMovementFlags:
if (hasMovementFlags)
@@ -16682,39 +16589,39 @@ void Unit::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
data >> mi->t_time;
break;
case MSETransportTime2:
if (hasTransportData && hasTransportTime2)
if (hasTransportData && mi->bits.hasTransportTime2)
data >> mi->t_time2;
break;
case MSETransportTime3:
if (hasTransportData && hasTransportTime3)
if (hasTransportData && mi->bits.hasTransportTime3)
data >> mi->t_time3;
break;
case MSEPitch:
if (hasPitch)
if (mi->bits.hasPitch)
data >> mi->pitch;
break;
case MSEFallTime:
if (hasFallData)
if (mi->bits.hasFallData)
data >> mi->fallTime;
break;
case MSEFallVerticalSpeed:
if (hasFallData)
if (mi->bits.hasFallData)
data >> mi->j_zspeed;
break;
case MSEFallCosAngle:
if (hasFallData && hasFallDirection)
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
data >> mi->j_cosAngle;
break;
case MSEFallSinAngle:
if (hasFallData && hasFallDirection)
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
data >> mi->j_sinAngle;
break;
case MSEFallHorizontalSpeed:
if (hasFallData && hasFallDirection)
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
data >> mi->j_xyspeed;
break;
case MSESplineElevation:
if (hasSplineElevation)
if (mi->bits.hasSplineElevation)
data >> mi->splineElevation;
break;
case MSEZeroBit:
@@ -16741,7 +16648,7 @@ void Unit::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
{ \
if (check) \
{ \
sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found (%s). " \
sLog->outDebug(LOG_FILTER_UNITS, "Unit::ReadMovementInfo: Violation of MovementFlags found (%s). " \
"MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Mask %u will be removed.", \
STRINGIZE(check), mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetGUIDLow(), maskToRemove); \
mi->RemoveMovementFlag((maskToRemove)); \
@@ -16807,22 +16714,46 @@ void Unit::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
#undef REMOVE_VIOLATING_FLAGS
}
void Unit::WriteMovementInfo(WorldPacket& data)
void Unit::WriteMovementInfo(WorldPacket& data) const
{
Unit* mover = GetCharmerGUID() ? GetCharmer() : this;
Unit const* mover = GetCharmerGUID() ? GetCharmer() : this;
if (Player const* player = ToPlayer())
mover = player->m_mover;
bool hasMovementFlags = mover->GetUnitMovementFlags() != 0;
bool hasMovementFlags2 = mover->GetExtraUnitMovementFlags() != 0;
bool hasTimestamp = GetTypeId() == TYPEID_PLAYER ? (mover->m_movementInfo.time != 0) : true;
bool hasOrientation = !G3D::fuzzyEq(mover->GetOrientation(), 0.0f);
bool hasTransportData = mover->GetTransport() != NULL;
bool hasTransportTime2 = mover->HasExtraUnitMovementFlag(MOVEMENTFLAG2_INTERPOLATED_MOVEMENT);
bool hasTransportTime3 = false;
bool hasPitch = mover->HasUnitMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || mover->HasExtraUnitMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING);
bool hasFallData = mover->HasExtraUnitMovementFlag(MOVEMENTFLAG2_INTERPOLATED_TURNING);
bool hasFallDirection = mover->HasUnitMovementFlag(MOVEMENTFLAG_FALLING);
bool hasSplineElevation = mover->HasUnitMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION);
bool hasSpline = false;
bool hasTransportData = GetTransGUID() != 0;
bool hasSpline = mover->IsSplineEnabled();
bool hasTransportTime2;
bool hasTransportTime3;
bool hasPitch;
bool hasFallData;
bool hasFallDirection;
bool hasSplineElevation;
if (GetTypeId() == TYPEID_PLAYER)
{
hasTransportTime2 = mover->m_movementInfo.bits.hasTransportTime2;
hasTransportTime3 = mover->m_movementInfo.bits.hasTransportTime3;
hasPitch = mover->m_movementInfo.bits.hasPitch;
hasFallData = mover->m_movementInfo.bits.hasFallData;
hasFallDirection = mover->m_movementInfo.bits.hasFallDirection;
hasSplineElevation = mover->m_movementInfo.bits.hasSplineElevation;
}
else
{
hasTransportTime2 = mover->HasExtraUnitMovementFlag(MOVEMENTFLAG2_INTERPOLATED_MOVEMENT);
hasTransportTime3 = false;
hasPitch = mover->HasUnitMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || mover->HasExtraUnitMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING);
hasFallDirection = mover->HasUnitMovementFlag(MOVEMENTFLAG_FALLING);
hasFallData = hasFallDirection; // FallDirection implies that FallData is set as well
// the only case when hasFallData = 1 && hasFallDirection = 0
// is for MSG_MOVE_LAND, which is handled above, in player case
hasSplineElevation = mover->HasUnitMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION);
}
MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode());
if (!sequence)
@@ -16832,7 +16763,7 @@ void Unit::WriteMovementInfo(WorldPacket& data)
}
ObjectGuid guid = mover->GetGUID();
ObjectGuid tguid = hasTransportData ? GetTransport()->GetGUID() : 0;
ObjectGuid tguid = hasTransportData ? GetTransGUID() : 0;
for (uint32 i = 0; i < MSE_COUNT; ++i)
{
@@ -17484,8 +17415,7 @@ void Unit::SendMovementHover()
ToPlayer()->SendMovementSetHover(HasUnitMovementFlag(MOVEMENTFLAG_HOVER));
WorldPacket data(MSG_MOVE_HOVER, 64);
data.append(GetPackGUID());
BuildMovementPacket(&data);
WriteMovementInfo(data);
SendMessageToSet(&data, false);
}
@@ -17495,8 +17425,7 @@ void Unit::SendMovementWaterWalking()
ToPlayer()->SendMovementSetWaterWalking(HasUnitMovementFlag(MOVEMENTFLAG_WATERWALKING));
WorldPacket data(MSG_MOVE_WATER_WALK, 64);
data.append(GetPackGUID());
BuildMovementPacket(&data);
WriteMovementInfo(data);
SendMessageToSet(&data, false);
}
@@ -17506,16 +17435,14 @@ void Unit::SendMovementFeatherFall()
ToPlayer()->SendMovementSetFeatherFall(HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW));
WorldPacket data(MSG_MOVE_FEATHER_FALL, 64);
data.append(GetPackGUID());
BuildMovementPacket(&data);
WriteMovementInfo(data);
SendMessageToSet(&data, false);
}
void Unit::SendMovementGravityChange()
{
WorldPacket data(MSG_MOVE_GRAVITY_CHNG, 64);
data.append(GetPackGUID());
BuildMovementPacket(&data);
WriteMovementInfo(data);
SendMessageToSet(&data, false);
}
@@ -17539,8 +17466,7 @@ void Unit::SendMovementCanFlyChange()
ToPlayer()->SendMovementSetCanFly(CanFly());
WorldPacket data(MSG_MOVE_UPDATE_CAN_FLY, 64);
data.append(GetPackGUID());
BuildMovementPacket(&data);
WriteMovementInfo(data);
SendMessageToSet(&data, false);
}
+12 -9
View File
@@ -758,13 +758,17 @@ enum MovementFlags2
MOVEMENTFLAG2_FULL_SPEED_TURNING = 0x00000004,
MOVEMENTFLAG2_FULL_SPEED_PITCHING = 0x00000008,
MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING = 0x00000010,
MOVEMENTFLAG2_UNK7 = 0x00000020,
MOVEMENTFLAG2_UNK8 = 0x00000040,
MOVEMENTFLAG2_UNK9 = 0x00000080,
MOVEMENTFLAG2_UNK10 = 0x00000100,
MOVEMENTFLAG2_INTERPOLATED_MOVEMENT = 0x00000200,
MOVEMENTFLAG2_INTERPOLATED_TURNING = 0x00000400,
MOVEMENTFLAG2_INTERPOLATED_PITCHING = 0x00000800
MOVEMENTFLAG2_UNK5 = 0x00000020,
MOVEMENTFLAG2_UNK6 = 0x00000040,
MOVEMENTFLAG2_UNK7 = 0x00000080,
MOVEMENTFLAG2_UNK8 = 0x00000100,
MOVEMENTFLAG2_UNK9 = 0x00000200,
MOVEMENTFLAG2_UNK10 = 0x00000400,
MOVEMENTFLAG2_UNK11 = 0x00000800,
MOVEMENTFLAG2_UNK12 = 0x00001000,
MOVEMENTFLAG2_INTERPOLATED_MOVEMENT = 0x00002000,
MOVEMENTFLAG2_INTERPOLATED_TURNING = 0x00004000,
MOVEMENTFLAG2_INTERPOLATED_PITCHING = 0x00008000
};
enum UnitTypeMask
@@ -2107,9 +2111,8 @@ class Unit : public WorldObject
void _ExitVehicle(Position const* exitPosition = NULL);
void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = NULL);
void BuildMovementPacket(ByteBuffer *data) const;
void ReadMovementInfo(WorldPacket& data, MovementInfo* mi);
void WriteMovementInfo(WorldPacket& data);
void WriteMovementInfo(WorldPacket& data) const;
bool isMoving() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_MOVING); }
bool isTurning() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_TURNING); }
+1 -9
View File
@@ -563,15 +563,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData)
_player->m_movementInfo = movementInfo;
WorldPacket data(SMSG_MOVE_UPDATE_KNOCK_BACK, 66);
data.appendPackGUID(movementInfo.guid);
_player->BuildMovementPacket(&data);
// knockback specific info
data << movementInfo.j_sinAngle;
data << movementInfo.j_cosAngle;
data << movementInfo.j_xyspeed;
data << movementInfo.j_zspeed;
_player->WriteMovementInfo(data);
_player->SendMessageToSet(&data, false);
}
@@ -77,6 +77,8 @@ namespace Movement
extern double gravity;
extern float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity);
extern UInt32Counter splineIdGen;
extern std::string MovementFlags_ToString(uint32 flags);
extern std::string MovementFlagsExtra_ToString(uint32 flags);
}
#endif // TRINITYSERVER_TYPEDEFS_H
@@ -113,18 +113,18 @@ namespace Movement
STR(Pitch_Up ), // 0x00000040,
STR(Pitch_Down ), // 0x00000080,
STR(Walk ), // 0x00000100, // Walking
STR(Levitation ), // 0x00000200,
STR(Walking ), // 0x00000100, // Walking
STR(DisableGravity ), // 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(FallingFar ), // 0x00001000,
STR(PendingStop ), // 0x00002000,
STR(PendingStrafeStop ), // 0x00004000,
STR(PendingForward ), // 0x00008000,
STR(PendingBackward ), // 0x00010000,
STR(PendingStrafeReft ), // 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
@@ -137,22 +137,26 @@ namespace Movement
STR(Local_Dirty ), // 0x20000000
STR(None31 ), // 0x40000000
STR(None32 ), // 0x80000000
STR(Unk1 ),
STR(Unk2 ),
STR(Unk3 ),
STR(Fullspeedturning ),
STR(Fullspeedpitching ),
STR(Allow_Pitching ),
STR(Unk4 ),
STR(Unk5 ),
STR(Unk6 ),
STR(Unk7 ),
STR(Interp_Move ),
STR(Interp_Turning ),
STR(Interp_Pitching ),
STR(None8 ),
STR(None9 ),
STR(None10 ),
};
char const* g_MovementFlagExtra_names[] =
{
STR(NoStrafe ),
STR(NoJump ),
STR(FullSpeedTurning ),
STR(FullSpeedPitching ),
STR(Allow_Pitching ),
STR(Unk6 ),
STR(Unk7 ),
STR(Unk8 ),
STR(Unk9 ),
STR(Unk10 ),
STR(Unk11 ),
STR(Unk12 ),
STR(Unk13 ),
STR(Interpolated_Movement),
STR(Interpolated_Turning ),
STR(Interpolated_Pitching),
};
char const* g_SplineFlag_names[32] =
@@ -207,4 +211,18 @@ namespace Movement
print_flags(raw(), g_SplineFlag_names, str);
return str;
}
std::string MovementFlags_ToString(uint32 flags)
{
std::string str;
print_flags(flags, g_MovementFlag_names, str);
return str;
}
std::string MovementFlagsExtra_ToString(uint32 flags)
{
std::string str;
print_flags(flags, g_MovementFlagExtra_names, str);
return str;
}
}