[c12609] Fix send-speed opcode sending

This commit is contained in:
Schmoozerd 2013-05-31 11:51:10 +01:00 committed by Antz
parent d24770cf34
commit 207359612d
2 changed files with 93 additions and 98 deletions

View file

@ -8793,15 +8793,11 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate, bool forced)
WorldPacket data;
ObjectGuid guid = GetObjectGuid();
if (forced)
{
if (GetTypeId() == TYPEID_PLAYER)
if (forced && GetTypeId() == TYPEID_PLAYER)
{
// register forced speed changes for WorldSession::HandleForceSpeedChangeAck
// and do it only for real sent packets and use run for run/mounted as client expected
++((Player*)this)->m_forced_speed_changes[mtype];
}
switch (mtype)
{
case MOVE_WALK:
@ -8905,12 +8901,12 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate, bool forced)
return;
}
SendMessageToSet(&data, true);
((Player*)this)->GetSession()->SendPacket(&data);
}
else
{
m_movementInfo.UpdateTime(WorldTimer::getMSTime());
// TODO: Actually such opcodes should (always?) be packed with SMSG_COMPRESSED_MOVES
switch (mtype)
{
case MOVE_WALK:
@ -8997,8 +8993,7 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate, bool forced)
return;
}
SendMessageToSet(&data, true);
}
SendMessageToSet(&data, false);
}
CallForAllControlledUnits(SetSpeedRateHelper(mtype, forced), CONTROLLED_PET | CONTROLLED_GUARDIANS | CONTROLLED_CHARM | CONTROLLED_MINIPET);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12608"
#define REVISION_NR "12609"
#endif // __REVISION_NR_H__