*More fix about move flag.
--HG-- branch : trunk
This commit is contained in:
@@ -1154,7 +1154,7 @@ void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint3
|
||||
|
||||
m_startMove = getMSTime();
|
||||
m_moveTime = time;*/
|
||||
SendMonsterMove(x, y, z, type, MovementFlags, time);
|
||||
SendMonsterMove(x, y, z, time);
|
||||
}
|
||||
|
||||
Player *Creature::GetLootRecipient() const
|
||||
|
||||
@@ -107,7 +107,7 @@ template<>
|
||||
inline void Traveller<Player>::MoveTo(float x, float y, float z, uint32 t)
|
||||
{
|
||||
//Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags
|
||||
i_traveller.SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_WALK_MODE, t);
|
||||
i_traveller.SendMonsterMove(x, y, z, t);
|
||||
}
|
||||
|
||||
typedef Traveller<Creature> CreatureTraveller;
|
||||
|
||||
+37
-9
@@ -362,10 +362,41 @@ void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 MovementFl
|
||||
transitTime = static_cast<uint32>(dist / speed + 0.5);
|
||||
}
|
||||
//float orientation = (float)atan2((double)dy, (double)dx);
|
||||
SendMonsterMove(x, y, z, 0, MovementFlags, transitTime, player);
|
||||
SendMonsterMove(x, y, z, transitTime, player);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player)
|
||||
void Unit::SendMonsterStop()
|
||||
{
|
||||
WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) );
|
||||
data.append(GetPackGUID());
|
||||
data << GetPositionX() << GetPositionY() << GetPositionZ();
|
||||
data << getMSTime();
|
||||
data << uint8(1);
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player)
|
||||
{
|
||||
WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) );
|
||||
data.append(GetPackGUID());
|
||||
|
||||
data << GetPositionX() << GetPositionY() << GetPositionZ();
|
||||
data << getMSTime();
|
||||
|
||||
data << uint8(0);
|
||||
data << uint32((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) ? MOVEFLAG_FLY : MOVEFLAG_WALK);
|
||||
|
||||
data << Time; // Time in between points
|
||||
data << uint32(1); // 1 single waypoint
|
||||
data << NewPosX << NewPosY << NewPosZ; // the single waypoint Point B
|
||||
|
||||
if(player)
|
||||
player->GetSession()->SendPacket(&data);
|
||||
else
|
||||
SendMessageToSet( &data, true );
|
||||
}
|
||||
|
||||
/*void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player)
|
||||
{
|
||||
WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) );
|
||||
data.append(GetPackGUID());
|
||||
@@ -404,9 +435,9 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 ty
|
||||
player->GetSession()->SendPacket(&data);
|
||||
else
|
||||
SendMessageToSet( &data, true );
|
||||
}
|
||||
}*/
|
||||
|
||||
void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, uint32 MovementFlags)
|
||||
void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end)
|
||||
{
|
||||
uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32);
|
||||
|
||||
@@ -418,13 +449,10 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, uin
|
||||
data << GetPositionY();
|
||||
data << GetPositionZ();
|
||||
|
||||
// unknown field - unrelated to orientation
|
||||
// seems to increment about 1000 for every 1.7 seconds
|
||||
// for now, we'll just use mstime
|
||||
data << getMSTime();
|
||||
|
||||
data << uint8( 0 );
|
||||
data << uint32( MovementFlags );
|
||||
data << uint32((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) ? MOVEFLAG_FLY : MOVEFLAG_WALK);
|
||||
data << uint32( traveltime );
|
||||
data << uint32( pathSize );
|
||||
data.append( (char*)path.GetNodes(start), pathSize * 4 * 3 );
|
||||
@@ -11992,7 +12020,7 @@ void Unit::StopMoving()
|
||||
// Relocate(GetPositionX(), GetPositionY(), z);
|
||||
Relocate(GetPositionX(), GetPositionY(),GetPositionZ());
|
||||
|
||||
SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), 0, true, 0);
|
||||
SendMonsterStop();
|
||||
|
||||
// update position and orientation;
|
||||
WorldPacket data;
|
||||
|
||||
+4
-2
@@ -1036,8 +1036,10 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, SpellSchoolMask damageSchoolMask,uint32 AbsorbedDamage, uint32 Resist,bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
|
||||
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo);
|
||||
|
||||
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
|
||||
void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, uint32 MovementFlags);
|
||||
void SendMonsterStop();
|
||||
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player = NULL);
|
||||
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
|
||||
void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end);
|
||||
void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 MovementFlags, uint32 transitTime = 0, Player* player = NULL);
|
||||
void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL);
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ FlightPathMovementGenerator::Initialize(Player &player)
|
||||
// do not send movement, it was sent already
|
||||
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
|
||||
|
||||
player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(),MOVEMENTFLAG_WALK_MODE|MOVEMENTFLAG_ONTRANSPORT);
|
||||
player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd());
|
||||
}
|
||||
|
||||
void FlightPathMovementGenerator::Finalize(Player & player)
|
||||
|
||||
Reference in New Issue
Block a user