Core/Movement: Added most spline speed changes.

This commit is contained in:
Drake Fish
2012-01-23 14:38:56 -05:00
parent 8a43bd7293
commit 00ff0d6fa0
+135 -7
View File
@@ -12661,25 +12661,153 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
data << float(GetSpeed(mtype));
break;
case MOVE_RUN_BACK:
data.Initialize(SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4);
data.Initialize(SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED, 1 + 8 + 4);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[6]);
data.WriteByteMask(bytes[3]);
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[1]);
data.WriteByteMask(bytes[7]);
data.WriteByteMask(bytes[2]);
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[7]);
data.WriteByteSeq(bytes[5]);
data.WriteByteSeq(bytes[3]);
data.WriteByteSeq(bytes[6]);
data.WriteByteSeq(bytes[4]);
data.WriteByteSeq(bytes[0]);
data.WriteByteSeq(bytes[2]);
data << float(GetSpeed(mtype));
break;
case MOVE_SWIM:
data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_SPEED, 8+4+2+4+4+4+4+4+4+4);
data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_SPEED, 1 + 8 + 4);
data.WriteByteMask(bytes[3]);
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[7]);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[2]);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[1]);
data.WriteByteMask(bytes[6]);
data.WriteByteSeq(bytes[0]);
data.WriteByteSeq(bytes[3]);
data.WriteByteSeq(bytes[6]);
data.WriteByteSeq(bytes[4]);
data.WriteByteSeq(bytes[2]);
data.WriteByteSeq(bytes[7]);
data << float(GetSpeed(mtype));
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[5]);
break;
case MOVE_SWIM_BACK:
data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4);
data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED, 1 + 8 + 4);
data.WriteByteMask(bytes[3]);
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[2]);
data.WriteByteMask(bytes[1]);
data.WriteByteMask(bytes[6]);
data.WriteByteMask(bytes[7]);
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[0]);
data.WriteByteSeq(bytes[2]);
data << float(GetSpeed(mtype));
data.WriteByteSeq(bytes[7]);
data.WriteByteSeq(bytes[3]);
data.WriteByteSeq(bytes[6]);
data.WriteByteSeq(bytes[4]);
data.WriteByteSeq(bytes[5]);
break;
case MOVE_TURN_RATE:
data.Initialize(SMSG_MOVE_SPLINE_SET_TURN_RATE, 8+4+2+4+4+4+4+4+4+4);
data.Initialize(SMSG_MOVE_SPLINE_SET_TURN_RATE, 1 + 8 + 4);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[1]);
data.WriteByteMask(bytes[6]);
data.WriteByteMask(bytes[3]);
data.WriteByteMask(bytes[7]);
data.WriteByteMask(bytes[2]);
data.WriteByteSeq(bytes[2]);
data.WriteByteSeq(bytes[4]);
data.WriteByteSeq(bytes[7]);
data.WriteByteSeq(bytes[0]);
data << float(GetSpeed(mtype));
data.WriteByteSeq(bytes[5]);
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[6]);
data.WriteByteSeq(bytes[3]);
break;
case MOVE_FLIGHT:
data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED, 8+4+2+4+4+4+4+4+4+4);
data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED, 1 + 8 + 4);
data.WriteByteMask(bytes[2]);
data.WriteByteMask(bytes[3]);
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[7]);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[6]);
data.WriteByteMask(bytes[1]);
data << float(GetSpeed(mtype));
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[0]);
data.WriteByteSeq(bytes[6]);
data.WriteByteSeq(bytes[7]);
data.WriteByteSeq(bytes[3]);
data.WriteByteSeq(bytes[2]);
data.WriteByteSeq(bytes[5]);
data.WriteByteSeq(bytes[4]);
break;
case MOVE_FLIGHT_BACK:
data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4);
data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4);
data.WriteByteMask(bytes[1]);
data.WriteByteMask(bytes[6]);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[2]);
data.WriteByteMask(bytes[7]);
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[3]);
data.WriteByteSeq(bytes[5]);
data.WriteByteSeq(bytes[6]);
data.WriteByteSeq(bytes[0]);
data.WriteByteSeq(bytes[4]);
data.WriteByteSeq(bytes[2]);
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[7]);
data << float(GetSpeed(mtype));
data.WriteByteSeq(bytes[3]);
break;
case MOVE_PITCH_RATE:
data.Initialize(SMSG_MOVE_SPLINE_SET_PITCH_RATE, 8+4+2+4+4+4+4+4+4+4);
data.Initialize(SMSG_MOVE_SPLINE_SET_PITCH_RATE, 1 + 8 + 4);
data.WriteByteMask(bytes[7]);
data.WriteByteMask(bytes[2]);
data.WriteByteMask(bytes[3]);
data.WriteByteMask(bytes[5]);
data.WriteByteMask(bytes[4]);
data.WriteByteMask(bytes[0]);
data.WriteByteMask(bytes[6]);
data.WriteByteMask(bytes[1]);
data.WriteByteSeq(bytes[0]);
data.WriteByteSeq(bytes[1]);
data.WriteByteSeq(bytes[7]);
data.WriteByteSeq(bytes[2]);
data.WriteByteSeq(bytes[3]);
data.WriteByteSeq(bytes[6]);
data.WriteByteSeq(bytes[5]);
data.WriteByteSeq(bytes[4]);
data << float(GetSpeed(mtype));
break;
default:
sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);