Created
April 28, 2014 21:07
-
-
Save cyberium/11384019 to your computer and use it in GitHub Desktop.
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 f097131..ad19f56 100644 | |
--- a/src/game/Unit.cpp | |
+++ b/src/game/Unit.cpp | |
@@ -8571,15 +8571,15 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate, bool forced) | |
const uint16 SetSpeed2Opc_table[MAX_MOVE_TYPE][2] = | |
{ | |
- {MSG_MOVE_SET_WALK_SPEED, SMSG_FORCE_WALK_SPEED_CHANGE}, | |
- {MSG_MOVE_SET_RUN_SPEED, SMSG_FORCE_RUN_SPEED_CHANGE}, | |
- {MSG_MOVE_SET_RUN_BACK_SPEED, SMSG_FORCE_RUN_BACK_SPEED_CHANGE}, | |
- {MSG_MOVE_SET_SWIM_SPEED, SMSG_FORCE_SWIM_SPEED_CHANGE}, | |
- {MSG_MOVE_SET_SWIM_BACK_SPEED, SMSG_FORCE_SWIM_BACK_SPEED_CHANGE}, | |
- {MSG_MOVE_SET_TURN_RATE, SMSG_FORCE_TURN_RATE_CHANGE}, | |
- {MSG_MOVE_SET_FLIGHT_SPEED, SMSG_FORCE_FLIGHT_SPEED_CHANGE}, | |
- {MSG_MOVE_SET_FLIGHT_BACK_SPEED, SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE}, | |
- {MSG_MOVE_SET_PITCH_RATE, SMSG_FORCE_PITCH_RATE_CHANGE}, | |
+ {SMSG_FORCE_WALK_SPEED_CHANGE, SMSG_SPLINE_SET_WALK_SPEED}, | |
+ {SMSG_FORCE_RUN_SPEED_CHANGE, SMSG_SPLINE_SET_RUN_SPEED}, | |
+ {SMSG_FORCE_RUN_BACK_SPEED_CHANGE, SMSG_SPLINE_SET_RUN_BACK_SPEED}, | |
+ {SMSG_FORCE_SWIM_SPEED_CHANGE, SMSG_SPLINE_SET_SWIM_SPEED}, | |
+ {SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, SMSG_SPLINE_SET_SWIM_BACK_SPEED}, | |
+ {SMSG_FORCE_TURN_RATE_CHANGE, SMSG_SPLINE_SET_TURN_RATE}, | |
+ {SMSG_FORCE_FLIGHT_SPEED_CHANGE, SMSG_SPLINE_SET_FLIGHT_SPEED}, | |
+ {SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, SMSG_SPLINE_SET_FLIGHT_BACK_SPEED}, | |
+ {SMSG_FORCE_PITCH_RATE_CHANGE, SMSG_SPLINE_SET_PITCH_RATE}, | |
}; | |
if (forced && GetTypeId() == TYPEID_PLAYER) | |
@@ -8588,15 +8588,19 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate, bool forced) | |
// and do it only for real sent packets and use run for run/mounted as client expected | |
++((Player*)this)->m_forced_speed_changes[mtype]; | |
- WorldPacket data(Opcodes(SetSpeed2Opc_table[mtype][1]), 18); | |
+ WorldPacket data(Opcodes(SetSpeed2Opc_table[mtype][0]), 18); | |
data << GetPackGUID(); | |
data << (uint32)0; // moveEvent, NUM_PMOVE_EVTS = 0x39 | |
if (mtype == MOVE_RUN) | |
data << uint8(0); // new 2.1.0 | |
data << float(GetSpeed(mtype)); | |
- | |
((Player*)this)->GetSession()->SendPacket(&data); | |
} | |
+ | |
+ WorldPacket data(Opcodes(SetSpeed2Opc_table[mtype][1]), 12); | |
+ data << GetPackGUID(); | |
+ data << float(GetSpeed(mtype)); | |
+ SendMessageToSet(&data, false); | |
} | |
CallForAllControlledUnits(SetSpeedRateHelper(mtype, forced), CONTROLLED_PET | CONTROLLED_GUARDIANS | CONTROLLED_CHARM | CONTROLLED_MINIPET); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment